imbajin commented on code in PR #357:
URL:
https://github.com/apache/hugegraph-computer/pull/357#discussion_r3650488630
##########
computer/computer-test/src/main/java/org/apache/hugegraph/computer/suite/integrate/SenderIntegrateTest.java:
##########
@@ -331,6 +368,50 @@ private WorkerService initWorker(String[] args) {
return service;
}
+ private static void waitForServices(List<CompletableFuture<Void>> futures)
{
+ CompletableFuture<Void> result = new CompletableFuture<>();
+ for (CompletableFuture<Void> future : futures) {
+ future.whenComplete((r, e) -> {
+ if (e != null) {
+ result.completeExceptionally(e);
Review Comment:
⚠️ Completing `result` on the first failure lets the caller enter cleanup
before the other service threads have initialized and published their service
references. A thread can add its service after `closeWorker()`/`closeMaster()`
has already observed `null` or finished iterating `workerServices`; the
multi-worker threads also do not own their services with try-with-resources.
That can leave Netty/etcd resources running into later tests. Please cancel and
join every spawned thread and ensure each thread closes any service it
initializes in a `finally`, including services published after the first
failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]