Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: pubsub ordering#7404

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 2 commits intomainfromspike/pubsub-ordering
May 5, 2023
Merged

fix: pubsub ordering#7404

spikecurtis merged 2 commits intomainfromspike/pubsub-ordering
May 5, 2023

Conversation

spikecurtis
Copy link
Contributor

This PR fixes the pubsub so that it calls back messages in order.

This is important for applications that depend on message order (as opposed to just using the pubsub as a kick to go load updates).

In particular, the streaming provisioner job logs endpoint isvery complicated and still broken (c.f.#7371) trying to deal with out of order messages.

As a second example, thehaCoordinator will fail even the most trivial example of a client or agent sending multiple node updates if the pubsub messages get reordered.

This PR creates an in-order queue of messages per subscriber (just a fixed sizechan) and runs a goroutine per subscriber (instead of per subscriberper message) to deliver them.

If the queue gets backed up, we drop messages rather than block. This was chosen rather than blocking the whole pubsub for a single Listener that isn't keeping up. Since thepg.Listener is, under the covers, handling DB reconnects, the pubsub can already drop messages, so from a design standpoint it's nothing new. In another PR I plan to add the capability for subscribers to get notified if messages are dropped.

Signed-off-by: Spike Curtis <spike@coder.com>
Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtisspikecurtis merged commita6a4489 intomainMay 5, 2023
@spikecurtisspikecurtis deleted the spike/pubsub-ordering branchMay 5, 2023 05:39
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 5, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

@EmyrkEmyrkAwaiting requested review from Emyrk

@coadlercoadlerAwaiting requested review from coadler

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@spikecurtis@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp