Skip to content

Commit 35725b2

Browse files
committed
Allow netty server to close with open connections
1 parent 177754a commit 35725b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

java/server/src/org/openqa/selenium/netty/server/NettyServer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ public URL getUrl() {
107107
@Override
108108
public void stop() {
109109
try {
110+
bossGroup.shutdownGracefully().sync();
111+
workerGroup.shutdownGracefully().sync();
112+
110113
channel.closeFuture().sync();
111114
} catch (InterruptedException e) {
112115
Thread.currentThread().interrupt();
113116
throw new UncheckedIOException(new IOException("Shutdown interrupted", e));
114117
} finally {
115118
channel = null;
116-
bossGroup.shutdownGracefully();
117-
workerGroup.shutdownGracefully();
118119
}
119120
}
120121

0 commit comments

Comments
 (0)