Inbox gates only the delivery's own message (#534) - #540
Merged
Merged
Conversation
…ng limits per tier (#534)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 481831564c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
Closes #534.
Problem
InboxBehavior<>gated every Command dispatched with a delivery'sIMessageBrokerContext. A Command that a received handler dispatches in-process withcontext.InMemory()inherits that context, so the Inbox treated it as the delivery itself:Fix
The Inbox now gates only the Delivery Entry: the first message it sees on the delivery's context in the current receive attempt.
BrokeredMessageReceiverinstalls a fresh entry at the start of each recovery attempt (BeginReceiveAttempt), above the virtualDispatchReceivedMessageAsync, so receiver overrides such asChangeFeedReceiverare covered. Every other message dispatched in-process in that attempt passes through the Inbox and runs. One internal change fixes all three Inbox tiers; no store contract and no public API change.Interim guarantee (ADR-0041 scope limits)
DispatchReceivedMessageAsyncdoes not start a new receive attempt and is outside the guarantee.The correct long-term design is an idempotent receiver at the delivery boundary (unit of work, Inbox and outbox around the whole delivery). That is epic #539, which also absorbs #538 (the Cosmos document tier's separate gate).
Consumer impact
No code change. A Command a received handler dispatches in-process now runs. The Inbox is not a loop guard: a handler that dispatches a new Command back into itself now loops on every Inbox tier.
Also
InMemoryBrokeredMessageOutboxcomment on when the processed stamp is written relative to publishing.Design record
Validation
dotnet testonChatter.sln(net10.0) at b89ef7e: all projects green (4423 passed, 2 known Azure Service Bus skips; one known CircuitBreaker timing flake passed on re-run). Later commits change docs and comments only; MessageBrokers 1413/1413, Reliability.EntityFramework 250/250, SqlChangeFeed 472/472, Reliability.Cosmos 580/580 at 4818315.MessageId) is pre-existing and governed by ADR-0009 and ADR-0015.Versioning
Chatter.MessageBrokers0.35.2 -> 0.35.3 (0.35.2 was never tagged). No other package changes.