Skip to content

Commit

Permalink
[FLINK-4387][QS] don't wait and process requests at Netty servers aft…
Browse files Browse the repository at this point in the history
…er shutdown request

There is a race condition on an assertion in Netty's event loop that may cause
tests to fail when finished early.

This was fixed in 4.0.33.Final, see netty/netty#4357.

This closes #5606.
  • Loading branch information
Nico Kruber authored and kl0u committed Mar 1, 2018
1 parent 45397fe commit 6ad626a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public void setUp() throws Exception {
@After
public void tearDown() throws Exception {
if (nioGroup != null) {
nioGroup.shutdownGracefully();
// note: no "quiet period" to not trigger Netty#4357
nioGroup.shutdownGracefully(0, 10, TimeUnit.SECONDS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public class KvStateServerTest {
@AfterClass
public static void tearDown() throws Exception {
if (NIO_GROUP != null) {
NIO_GROUP.shutdownGracefully();
// note: no "quiet period" to not trigger Netty#4357
NIO_GROUP.shutdownGracefully(0, 10, TimeUnit.SECONDS);
}
}

Expand Down Expand Up @@ -191,7 +192,8 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
if (bootstrap != null) {
EventLoopGroup group = bootstrap.group();
if (group != null) {
group.shutdownGracefully();
// note: no "quiet period" to not trigger Netty#4357
group.shutdownGracefully(0, 10, TimeUnit.SECONDS);
}
}
}
Expand Down

0 comments on commit 6ad626a

Please sign in to comment.