Document force: shutdown parameter and graceful-by-default behavior - #995
Open
coipond-writer[bot] wants to merge 1 commit into
Open
Document force: shutdown parameter and graceful-by-default behavior#995coipond-writer[bot] wants to merge 1 commit into
coipond-writer[bot] wants to merge 1 commit into
Conversation
waterdrop/lib/waterdrop/connection_pool.rb: instance #shutdown(force: false) (line 247) and class-level ConnectionPool.shutdown(force: false) (line 118), both aliased to #close, now close pooled producers gracefully by default (flushing buffered messages) instead of always force-closing and purging. Per the docstring: "Defaults to false: producers are closed gracefully so in-flight messages are flushed instead of being silently dropped when the broker is slow or unreachable." force: true restores the old force-close-and-purge behavior. The page showed only the bare .close call with no mention of force: or the behavior change. Added documentation of the default and the force: option. Fixes #44807.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
`WaterDrop/Connection-Pool.md` showed `WaterDrop::ConnectionPool.close` with no arguments and never mentioned a `force:` option or a behavior change.
Why it's incomplete
`waterdrop/lib/waterdrop/connection_pool.rb`: instance `#shutdown(force: false)` (line 247) and class-level `ConnectionPool.shutdown(force: false)` (line 118), both aliased to `#close`, now close pooled producers gracefully by default (flushing buffered messages) instead of always force-closing and purging. Per the source docstring: "Defaults to false: producers are closed gracefully so in-flight messages are flushed instead of being silently dropped when the broker is slow or unreachable." `force: true` restores the old force-close-and-purge behavior.
Fix
Documented the default graceful behavior and the `force:` option right after the existing close example.
Fixes #44807 (Redmine).