Skip to content

[Broker] Preventing extra dispatch when entries will make permits negative#10396

Closed
devinbost wants to merge 2 commits intoapache:masterfrom
devinbost:preventing_extra_dispatch
Closed

[Broker] Preventing extra dispatch when entries will make permits negative#10396
devinbost wants to merge 2 commits intoapache:masterfrom
devinbost:preventing_extra_dispatch

Conversation

@devinbost
Copy link
Contributor

I noticed that the broker currently does not consider the number of entries when determining if it should dispatch messages to the consumer. Due to the missing check, the broker can send more messages than available permits.
This PR prevents that from happening for persistent topics.

Related to #6054

@devinbost
Copy link
Contributor Author

@rdhabalia @codelipenghui @merlimat @sijie Anything else I should add to this PR?

@merlimat
Copy link
Contributor

The reason for this is that we want to avoid having to re-read messages again from storage. The number of permits going to negative is "fine", in the sense that the next round will adjust.

@devinbost
Copy link
Contributor Author

@devinbost
Copy link
Contributor Author

I'm closing this because there are a number of areas that expect permits to be <= 0 to control message flow, and this PR doesn't address the root issue behind subscriptions getting stuck.

@devinbost devinbost closed this Apr 27, 2021
@devinbost devinbost deleted the preventing_extra_dispatch branch April 27, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants