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
Merged

Add GracefulShutdownService #5738

merged 10 commits into from
Mar 1, 2019

Commits on Feb 28, 2019

  1. 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 committed Feb 28, 2019
    Configuration menu
    Copy the full SHA
    be5746b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b4d256 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1a54aa8 View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2019

  1. 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.
    bernd committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    d81466c View commit details
    Browse the repository at this point in the history
  2. Make graceful shutdown logging more verbose

    This will make it easier for users to debug a hanging shutdown process.
    bernd committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    0cff931 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d8dc84c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1013655 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    14d6865 View commit details
    Browse the repository at this point in the history
  6. 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.
    bernd committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    b78be52 View commit details
    Browse the repository at this point in the history
  7. 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 committed Mar 1, 2019
    Configuration menu
    Copy the full SHA
    779006e View commit details
    Browse the repository at this point in the history