chibenwa commented on a change in pull request #886:
URL: https://github.com/apache/james-project/pull/886#discussion_r816674020



##########
File path: 
protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
##########
@@ -128,17 +125,19 @@ protected void configureBootstrap(ServerBootstrap 
bootstrap) {
     
     @Override
     public synchronized void unbind() {
-        if (started == false) {
+        if (!started) {
             return;
         }
 
+        List<Future<?>> futures = new ArrayList<>();
         if (bossGroup != null) {
-            bossGroup.shutdownGracefully();
+            futures.add(bossGroup.shutdownGracefully());
         }
 
         if (workerGroup != null) {
-            workerGroup.shutdownGracefully();
+            futures.add(workerGroup.shutdownGracefully());
         }
+        
futures.forEach(Throwing.<Future<?>>consumer(Future::await).sneakyThrow());

Review comment:
       I have some fixups : gracefull shutdown take time and we might not want 
it for tests 
   
   CF https://github.com/apache/james-project/pull/898
   
   IMO graceful shutdown is not a requirement for Netty 4 adoption but merely a 
nice enhancement. I would likely not add it in this pull request and keep it 
separate...




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

Reply via email to