Repository navigation
perf(redis): poll the stream every 5 s while the notify doorbell is live - #265
Merged
Merged
Conversation
cosmin-staicu
requested review from
alinahornet,
cosminvlad,
litheon,
lucianaparaschivei and
razvalex
as code owners
October 21, 2026 10:57
|
🔎 Maintainer heads-up: automated triage flagged this PR as potentially material, so it may need a signed CLA in addition to the DCO sign-off. Strong signals
This is advisory only — the bot does not decide. Please judge against the CLA criteria (material, product-critical, patent-sensitive, corporate contributor, broad commercial use). Note that thresholds can be gamed by splitting PRs, so use your judgement.
|
cosmin-staicu
force-pushed
the
perf/poll-interval
branch
2 times, most recently
from
October 21, 2026 14:19
146ef85 to
b836f56
Compare
alinahornet
previously approved these changes
Oct 21, 2026
NotifiedPollInterval is the cadence while the doorbell subscription is confirmed live; PollInterval stays the cadence before the first subscribe, after a forced reconnect until the topic subscribes again, while a subscription connection is down, when the server refuses the subscription and with NotifyEnabled false. Unset, it is 5 s when PollInterval was not set and PollInterval when it was; a PollInterval key in configuration counts as set, and options bound from configuration keep an absent key unset. An explicit value must be positive and at least PollInterval; PollInterval must be positive. The doorbell reads as down only for the subscription connections that failed, tracked per endpoint, and comes back with the last of them. A failure landing while a subscribe completes, or a reconnect racing its end, keeps it down. Losing it ends a wait in progress at the long interval. Failure retries and the XINFO GROUPS position check stay on PollInterval. Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
cosmin-staicu
force-pushed
the
perf/poll-interval
branch
from
October 21, 2026 15:38
f540cae to
0a093db
Compare
alinahornet
self-requested a review
October 21, 2026 16:12
alinahornet
approved these changes
Oct 21, 2026
|
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.



Redis Streams consumers poll every
PollInterval(250 ms) even when the Pub/Sub doorbell already wakes them on each write. Idle, that is about 15 server-executed commands per second per topic per process.RedisStreamsTopicOptions.NotifiedPollIntervalis the poll cadence while the doorbell subscription is confirmed live.PollIntervalstays the cadence whenever it is not: before the first subscribe, after a reconnect until the topic subscribes again, while the subscription connection is down, when the server refuses the subscription, and withNotifyEnabledoff. Losing the doorbell ends a wait already in progress at the long interval. Failure retries and theXINFO GROUPSposition check stay onPollInterval.Unset, it is 5 s when
PollIntervalwas not set, andPollIntervalwhen it was, so an app that configuredPollIntervalkeeps its cadence. APollIntervalkey in configuration counts as set even at 250 ms, and a global one counts for every topic; options bound throughAddRedisStreams(sectionName)and the per-topic sections keep an absent key unset. An explicit value must be positive and at leastPollInterval.The doorbell reads as down only for the subscription connections that failed, tracked per endpoint, and comes back with the last of them; a failure that lands while a subscribe completes keeps it down.
PollIntervalmust now be positive.Why 5 s
Measured per process with 3 topics, single Redis, loopback:
The saving per extra second of worst-case staleness drops from 6.0 commands/s (1 → 2 s) to 1.4 (2 → 5 s) and 0.24 (5 → 10 s). The worst case only applies to a message dropped while the subscription still looks live; every outage the library can detect falls back to
PollInterval. Events are lost only aboveMaxLength / intervalper second per topic, about 6 500/s at 5 s with the defaultMaxLength.Tests
Clone.