Skip to content

Commit 62aa0e5

Browse files
committed
[grid] speed up the server shutdown
1 parent 305280b commit 62aa0e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: java/src/org/openqa/selenium/netty/server/NettyServer.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import io.netty.handler.ssl.SslContext;
2828
import io.netty.handler.ssl.SslContextBuilder;
2929
import io.netty.handler.ssl.util.SelfSignedCertificate;
30+
import io.netty.util.concurrent.Future;
3031
import io.netty.util.internal.logging.InternalLoggerFactory;
3132
import io.netty.util.internal.logging.JdkLoggerFactory;
3233
import java.io.IOException;
@@ -127,8 +128,11 @@ public URL getUrl() {
127128
@Override
128129
public void stop() {
129130
try {
130-
bossGroup.shutdownGracefully().sync();
131-
workerGroup.shutdownGracefully().sync();
131+
Future<?> bossShutdown = bossGroup.shutdownGracefully();
132+
Future<?> workerShutdown = workerGroup.shutdownGracefully();
133+
134+
bossShutdown.sync();
135+
workerShutdown.sync();
132136

133137
channel.closeFuture().sync();
134138
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)