Repository navigation
Poll queue settings as a fallback when a notifier is configured - #1582
Merged
brandur merged 2 commits intoNov 5, 2026
Merged
Conversation
A queue pause or resume reaches running clients only by NOTIFY. If the notification is lost, like while the notifier is reconnecting, the client keeps working the queue until it restarts, because pollForSettingChanges only ran in poll-only mode. Run it with a notifier too, once a minute, as riverqueue#1564 did for job cancellation. Also give the notifier's health check ping a timeout. A connection that goes silent without an error blocked the ping, so the notifier never reconnected. Fixes riverqueue#1579.
…reconnect Apply a few more fixes on top of the original changes in riverqueue#1582: * More reliable Go state reconciliation: Polling compares database settings against producer's applied state. Fixes a received pause followed by a lost resume leaving the producer paused indefinitely. Metadata changes followed by reversions are also fixed. * Metadata dedup: Polling skips metadata already applied through a notification, avoiding duplicate callbacks. * Shared fallback interval: Queue settings and cancellation polling use `NotificationPollInterval`, defaulting to one minute. Rust uses the same. * Cleaner shutdown: Queue settings polling stops when fetching stops. Cancellation polling continues while running jobs drain. * Rust recover: Adds periodic queue settings refresh when notifier exists, supplementing existing refresh on reconnect Reuses existing timer. * Expanded tests: Extend Yash's polling test to cover metadata. Add regression for notification /poll interactions and duplicate callbacks. Add shared Go driver and Rust Postgres/SQLite coverage. * Docs and small fixes: Documents fallback polling, updates changeslogs, and fixes the Go notification test helper to encode metadata as JSON rather than base64.
brandur
approved these changes
Nov 5, 2026
Contributor
|
Thanks! |
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.
Fixes #1579.
A queue pause or resume reaches running clients only by NOTIFY. If the notification is sent while a client's notifier is reconnecting, it's lost, and the client keeps working the queue until it restarts.
pollForSettingChangesalready handles this in poll-only mode, but it only ran whenNotifier == nil.