Skip to content

Document force: shutdown parameter and graceful-by-default behavior - #995

Open
coipond-writer[bot] wants to merge 1 commit into
masterfrom
fix/waterdrop-connection-pool-force-shutdown-44807
Open

Document force: shutdown parameter and graceful-by-default behavior#995
coipond-writer[bot] wants to merge 1 commit into
masterfrom
fix/waterdrop-connection-pool-force-shutdown-44807

Conversation

@coipond-writer

Copy link
Copy Markdown
Contributor

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).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

0 participants