fluss icon indicating copy to clipboard operation
fluss copied to clipboard

[rpc] NettyClient.close() always waits for Netty's 2 s shutdown quiet period

Open dstolis opened this issue 1 month ago • 1 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Description

NettyClient.close() shuts down its event loop group via NettyUtils.shutdownGroup(), which calls EventLoopGroup.shutdownGracefully() with Netty's defaults (2 s quiet period, 15 s timeout). Every NettyClient.close(), and therefore every Connection.close(), blocks for at least ~2 s, even though all connections are already closed and no more tasks will be submitted.

This adds up in tests, which open and close connections constantly. Example from TieringCommitOperatorTest: every test takes a multiple of ~2.1 s (4.2, 6.3, 8.5, 10.5 s), and the gaps in the logs sit around "Netty client was shutdown successfully."

Proposed fix (client side only): wait for the connection close futures first, then shut down the client event loop group with a zero quiet period. The server side is left as is: removing the quiet period there made cluster shutdown hang in TabletServer.stopServices().

Willingness to contribute

  • [x] I'm willing to submit a PR!

dstolis avatar Oct 14 '26 15:10 dstolis

Fixed in https://github.com/apache/fluss/pull/4817

wuchong avatar Nov 20 '26 12:11 wuchong