Skip to content

Commit

Permalink
[grid] speed up the server shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Nov 9, 2024
1 parent 305280b commit 62aa0e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions java/src/org/openqa/selenium/netty/server/NettyServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 62aa0e5

Please sign in to comment.