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 graceful shutdown of channels #95

Merged

Conversation

onobc
Copy link
Collaborator

@onobc onobc commented Jan 13, 2025

This commit provides graceful shutdown of all channels created by the channel factory.

Resolves #12

This commit provides graceful shutdown of all channels
created by the channel factory.

Resolves spring-projects-experimental#12

Co-authored-by: Andrey Litvitski <[email protected]>
ChannelBuilderOptions.defaults().withShutdownGracePeriod(Duration.ofSeconds(10)));

// spy each channel to wait accordingly
var c1Spy = setupSpy(c1);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not excited about having to get in and spy like this. However, it is a necessary evil to get some basic test coverage.

Namely, we ensure each channel gets the following:

  • shutdown invoked
  • awaitTermination invoked
  • shutdownNow never invoked EXCEPT only on channel2 when exceedAwaitTime = true

@dsyer dsyer merged commit 5ef993f into spring-projects-experimental:main Jan 13, 2025
1 check passed
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.

Support for shutdown grace period in netty clients
2 participants