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

FIX: Ensure non-long-polling requests are always spaced out #324

Merged
merged 7 commits into from
Jan 6, 2023

Conversation

davidtaylorhq
Copy link
Member

When long-polling, after a request returns some data, message-bus will immediately begin another long-polling request to maintain a consistent stream of messages.

When not long polling, we do not expect a continuous stream of messages, and the client aims to make one request every backgroundCallbackInterval (default 60s).

Before this commit, some long-polling logic was leaking into the non-long-polling requests. Under certain situations (e.g. a channel receiving very frequent messages), this could cause clients to start issuing non-long-polling requests every minPollInterval (100ms). This commit fixes the logic so that 'immediate retry' is only performed when in long-polling mode.

This commit does not introduce any behaviour change
When long-polling, after a request returns some data, message-bus will immediately begin another long-polling request to maintain a consistent stream of messages.

When not long polling, we do not expect a continuous stream of messages, and the client aims to make one request every `backgroundCallbackInterval` (default 60s).

Before this commit, some long-polling logic was leaking into the non-long-polling requests. Under certain situations (e.g. a channel receiving very frequent messages), this could cause clients to start issuing non-long-polling requests every `minPollInterval` (100ms). This commit fixes the logic so that 'immediate retry' is only performed when in long-polling mode.
Copy link
Member

@ZogStriP ZogStriP left a comment

Choose a reason for hiding this comment

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

LGTM

@davidtaylorhq davidtaylorhq merged commit 233b248 into main Jan 6, 2023
@davidtaylorhq davidtaylorhq deleted the non-long-poll-interval branch January 6, 2023 14:11
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.

None yet

3 participants