From 62aa0e551e79176f21e3e1658518bc40855f81ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sautter?= Date: Sat, 9 Nov 2024 20:33:01 +0100 Subject: [PATCH] [grid] speed up the server shutdown --- .../src/org/openqa/selenium/netty/server/NettyServer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/src/org/openqa/selenium/netty/server/NettyServer.java b/java/src/org/openqa/selenium/netty/server/NettyServer.java index 8cde75d95485e..c6b284bcbc62f 100644 --- a/java/src/org/openqa/selenium/netty/server/NettyServer.java +++ b/java/src/org/openqa/selenium/netty/server/NettyServer.java @@ -27,6 +27,7 @@ import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.SelfSignedCertificate; +import io.netty.util.concurrent.Future; import io.netty.util.internal.logging.InternalLoggerFactory; import io.netty.util.internal.logging.JdkLoggerFactory; import java.io.IOException; @@ -127,8 +128,11 @@ public URL getUrl() { @Override public void stop() { try { - bossGroup.shutdownGracefully().sync(); - workerGroup.shutdownGracefully().sync(); + Future bossShutdown = bossGroup.shutdownGracefully(); + Future workerShutdown = workerGroup.shutdownGracefully(); + + bossShutdown.sync(); + workerShutdown.sync(); channel.closeFuture().sync(); } catch (InterruptedException e) {