amaliujia commented on code in PR #1647:
URL: https://github.com/apache/ratis/pull/1647#discussion_r4356538470


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -604,14 +613,14 @@ private void closeImpl(Throwable cause) {
       failure = e;
       throw e;
     } finally {
-      completeClose(failure);
+      completeClose(failure, allServers);
     }
   }
 
-  private void completeClose(Throwable cause) {
+  private void completeClose(Throwable cause, boolean allServers) {
     lifeCycle.transitionIfNotEqual(State.CLOSED);
     if (cause == null) {
-      closeFuture.complete(null);
+      closeFuture.complete(allServers);
     } else {
       closeFuture.completeExceptionally(cause);
     }

Review Comment:
   I actually reverted this suggestion. Found test failures which indicates 
that, this closeFuture.completeExceptionally is used by somewhere else: 
https://github.com/apache/ratis/blob/master/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java#L486-L495
   
   test failures from this job: 
https://github.com/apache/ratis/actions/runs/39903654392/job/120250580159?pr=1647
   
   So basically there is other code depending on this 
`closeFuture.completeExceptionally` so it cannot be dropped. Then if we do not 
want to lose `allServers` here, probably one way is to wrap it into our 
exception. WDYT? 



-- 
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]

Reply via email to