[FLINK-4741] Fix for the proper shutdown the ServerBootstrap in the process of stopping the WebRuntumeMonitor #2862
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[FLINK-4741] WebRuntimeMonitor does not shut down all of it's threads (EventLoopGroups) on exit.
bootstrap.childGroup().shutdownGracefully() method has been added to the correct shutdown WebRuntimeMonitor.
More detailed explanation:
bootrstrap - it is io.netty.bootstrap.ServerBootstrap - a helper class that sets up a netty-server.
In its work netty-server uses two EventLoopGroups:
The first one, often called 'boss', accepts an incoming connection.
The second one, often called 'worker', handles the traffic of the accepted connection once the boss accepts the connection and registers the accepted connection to the worker.
At the end of netty-server work should be shut down all the threads in each of the two EventLoopGroups.
First EventLoopGroups stops when called bootstrap.group().shutdownGracefully().
To stop the second EventLoopGroups this request adds call of bootstrap.chiledGroup().shutdownGracefully() method.
This proposal corresponds to netty user guide:
https://netty.io/wiki/user-guide-for-4.x.html