StefanRRichter commented on a change in pull request #7665: [FLINK-11551][rpc] 
Allow RpcEndpoint to execute asynchronous stop operations
URL: https://github.com/apache/flink/pull/7665#discussion_r255890552
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcService.java
 ##########
 @@ -315,33 +315,48 @@ public void stopServer(RpcServer selfGateway) {
                        }
 
                        if (rpcEndpoint != null) {
-                               
akkaClient.getActorRef().tell(PoisonPill.getInstance(), ActorRef.noSender());
+                               terminateAkkaRpcActor(akkaClient.getActorRef(), 
rpcEndpoint);
                        } else {
                                LOG.debug("RPC endpoint {} already stopped or 
from different RPC service", selfGateway.getAddress());
                        }
                }
        }
 
+       private CompletableFuture<Void> terminateAkkaRpcActor(ActorRef 
akkaRpcActorRef, RpcEndpoint rpcEndpoint) {
+               akkaRpcActorRef.tell(ControlMessages.TERMINATE, 
ActorRef.noSender());
+
+               return rpcEndpoint.getTerminationFuture();
+       }
+
        @Override
        public CompletableFuture<Void> stopService() {
+               LOG.info("Stopping Akka RPC service.");
 
 Review comment:
   Depending on what you want to see from this message, it could be more 
precise to move the logging under the if `if` statement that starts in 338.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to