feat(batching): ProbeIndividuallyAfter(N) count-based batch member isolation (GH-3289 Phase 3c)#3312
Merged
Conversation
…olation (GH-3289 Phase 3c) Phase 3c of the #3289 batch-processing plan: item 2, the count-based sibling of IsolateBatchMembers. For opaque batch failures with no exception type to key on: opts.BatchMessagesOf<Order>(b => b.ProbeIndividuallyAfter(attempts: 3)); retries the WHOLE batch N times (letting transient failures clear), then re-runs each member as its own size-1 batch so only the genuinely bad one dead-letters. - ProbeIndividuallyContinuation gains a probeAfterAttempts threshold: it requeues the whole batch (DeferAsync) while Envelope.Attempts < threshold, then probes. Size-<=1 batches still dead-letter immediately (terminating case). IsolateBatchMembers keeps its threshold of 1 (probe on the first failure) - behavior unchanged. - BatchingOptions.ProbeIndividuallyAfter(N) stores the threshold; a new startup step applyBatchProbePolicies() installs it as an every-attempt failure rule on the batch handler chain (batchChain.OnException<Exception>().ContinueWith(...)). Test (DB-free): the whole 3-item batch is retried exactly 3 times, then the probe isolates the poison item - the two healthy members succeed as singletons and only the bad one is dead-lettered. Item 3 (IsolateBatchMembers) and 3a tests still green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 9, 2026
Merged
This was referenced Jul 13, 2026
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.
Phase 3c of the #3289 batch-processing plan: item 2 (
ProbeIndividuallyAfter), the count-based sibling of item 3'sIsolateBatchMembers(#3311). (Phases 0/1/2/3a/3b all merged.)The feature
When you don't have a specific exception type to key on — the batch just fails and you can't tell transient from poison — configure a count-based probe directly on the batch:
It retries the whole batch
Ntimes (so a transient failure clears on retry), and only then re-runs each member as its own size-1 batch so only the genuinely bad one dead-letters.Implementation
ProbeIndividuallyContinuationgains aprobeAfterAttemptsthreshold: it requeues the whole batch (DeferAsync) whileEnvelope.Attempts < threshold, then probes into singletons. The size-≤1 guard still dead-letters immediately (terminating case + probed singletons).IsolateBatchMemberskeeps threshold1(probe on first failure) — behavior unchanged, verified by re-running its tests.BatchingOptions.ProbeIndividuallyAfter(N)stores the threshold; a new startup stepapplyBatchProbePolicies()(next to the existingwarnOrAssertBatchHandlerConflicts) installs it as an every-attempt failure rule on the batch handler chain viabatchChain.OnException<Exception>().ContinueWith(new ProbeIndividuallyContinuationSource(N)).Test (DB-free)
batch_probe_individually_after.cs: the whole 3-item batch is retried exactly 3 times (asserted), then the probe isolates the poison item — the two healthy members succeed as singletons and onlybadis dead-lettered (captured viaIDeadLetterInterceptor). Item 3 + 3a isolation tests still green;dotnet build wolverine.slnx -c Releaseclean.Remaining plan follow-up
Only the
CoalesceBysame-key poisoning refinement forApplyItemException(flagged in #3302) remains — a small final PR.🤖 Generated with Claude Code