Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backup/backupServer): make the thread pool close after the netty channel closes #5859

Closed
wants to merge 1 commit into from

Conversation

halibobo1205
Copy link
Contributor

@halibobo1205 halibobo1205 commented Jun 18, 2024

What does this PR do?
Make the thread pool close after the netty channel closes.
Why are these changes required?
Make the SR node that enables the master/slave generating-block model to be stopped normally by kill -15.

channel.closeFuture().sync(); //  wait for the main channel (listening socket) to shutdown (closeFuture().sync()) where closeFuture gives you the "future" on "close" operation (meaning shutdown of the server socket), and sync waiting for this future to be done.
image

As shown below, the thread pool is closed first, and then the channel is closed. the thread can not exit because it is synchronized waiting for the channel close event, which prevents the thread pool from closing properly.
image

Finally, after 60 seconds of waiting, the thread pool is forced to close.
image

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@halibobo1205
Copy link
Contributor Author

see #5868.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant