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

Add GracefulShutdownService #5738

Merged
merged 10 commits into from Mar 1, 2019

Conversation

@bernd
Copy link
Member

commented Feb 28, 2019

Services can register themselves with the GracefulShutdownService to
make sure they will be stopped gracefully on server shutdown.

This allows plugins to participate in a graceful server shutdown to
make sure the server is not terminated before the plugin shutdown
routine is done.

Add GracefulShutdownService
Services can register themselves with the GracefulShutdownService to
make sure they will be stopped gracefully on server shutdown.

This allows plugins to participate in a graceful server shutdown to
make sure the server is not terminated before the plugin shutdown
routine is done.

@bernd bernd force-pushed the graceful-shutdown-service branch from 2fa5883 to be5746b Feb 28, 2019

@bernd bernd requested a review from kroepke Feb 28, 2019

@danotorrey

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2019

@bernd @ceruleancee This tests successfully with the Forwarder.

bernd added 5 commits Mar 1, 2019
Don't allow register/unregister when the shutdown is running
Once the shutdown has started, we cannot modify the set of hooks because
that might to race conditions and a hanging shutdown.

Objects that try to register/unregister during the shutdown phase will
get an IllegalStateException that should be handled.
Make graceful shutdown logging more verbose
This will make it easier for users to debug a hanging shutdown process.

@bernd bernd marked this pull request as ready for review Mar 1, 2019

@bernd

This comment has been minimized.

Copy link
Member Author

commented Mar 1, 2019

@danotorrey @ceruleancee I added some more changes, please test again. Thank you! 😃

Fix race condition in failRegisterAndUnregisterDuringShutdown test
We don't really need a blocking latch in the hook because we can also
check the behavior after the service is terminated.
@kroepke
Copy link
Member

left a comment

Minor comment only.
LGTM

No need to wait for the termination of the executor
The latch is open at this point and all shutdown hooks have been
executed.

@bernd bernd requested a review from kroepke Mar 1, 2019

@kroepke
kroepke approved these changes Mar 1, 2019

@kroepke kroepke merged commit 7b037a3 into master Mar 1, 2019

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci-web-linter Jenkins build graylog-pr-linter-check 3417 has succeeded
Details
graylog-project/pr Jenkins build graylog-project-pr-snapshot 3237 has succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@kroepke kroepke deleted the graceful-shutdown-service branch Mar 1, 2019

bernd added a commit that referenced this pull request Mar 1, 2019
Add GracefulShutdownService (#5738)
Services can register themselves with the GracefulShutdownService to
make sure they will be stopped gracefully on server shutdown.

This allows plugins to participate in a graceful server shutdown to
make sure the server is not terminated before the plugin shutdown
routine is done.

(cherry picked from commit 7b037a3)
kroepke added a commit that referenced this pull request Mar 1, 2019
Add GracefulShutdownService (#5738) (#5739)
Services can register themselves with the GracefulShutdownService to
make sure they will be stopped gracefully on server shutdown.

This allows plugins to participate in a graceful server shutdown to
make sure the server is not terminated before the plugin shutdown
routine is done.

(cherry picked from commit 7b037a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.