fix(relay): enforce scoped budgets consistently at every ingress - #25
Closed
albertovincenzi wants to merge 1 commit into
Closed
Conversation
Contributor
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.
Problem
Scoped-budget validation disagreed across the two supported ingress paths. HTTP rejected a missing scope even when whenOp made that budget irrelevant to the item. A producer writing directly to a user-owned ingress queue had the opposite and more dangerous behavior: when an applicable scope was absent, the relay silently skipped that counter and forwarded the item under only the other budgets.
Fix
Dependency
This PR is intentionally based on #10, which first makes shed-mode budget selection match relay selection. The new helper completes that same applicability contract for scope validation.
Review notes for Alice
The relay does not drop a malformed item silently: it uses the existing poison path, which nacks the head with a reason and increments dead-letter telemetry. A missing scope is immutable in the queued payload and cannot become admissible on retry, while forwarding it would violate the declared per-key limit. Please pay particular attention to ordering in classify: foreign ownership is resolved before payload validation.
Verification