Repository navigation
Isolate inbound payload hydration failures to their deliveries - #829
Open
wangbill (YunchuWang) wants to merge 1 commit into
Open
wangbill (YunchuWang) wants to merge 1 commit into
wangbill (YunchuWang) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change to isolate payload hydration failures to individual deliveries.
No open issues 🎉
What changed in this PR
This PR addresses #825 by isolating inbound payload hydration failures to individual deliveries, preserving the Durable Task worker’s shared stream and unrelated in-flight work.
Changes:
- Introduces an internal exception carrying the failed delivery and its completion token.
- Reads work items directly and reuses abandonment logic, tolerating ownership loss while preserving connection-level recovery for other failures.
- Adds consumer and HTTP/2 loopback regression coverage plus an Unreleased changelog entry.
| File | Description |
|---|---|
test/Worker/Grpc.Tests/WorkItemStreamConsumerTests.cs |
Tests delivery recovery, callback ordering, and failure propagation. |
test/Grpc.IntegrationTests/PayloadHydrationFailureTests.cs |
Adds loopback coverage for isolation, redelivery, reconnection, and shutdown. |
src/Worker/Grpc/WorkItemStreamConsumer.cs |
Uses direct stream reads with delivery-local recovery. |
src/Worker/Grpc/Worker.Grpc.csproj |
Grants integration tests access to worker internals. |
src/Worker/Grpc/Logs.cs |
Adds ownership-loss logging. |
src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs |
Handles hydration failures using shared abandonment logic. |
src/Grpc/WorkItemPayloadException.cs |
Defines the internal failed-delivery exception. |
src/Grpc/Grpc.csproj |
Exposes the internal contract to consuming assemblies and tests. |
src/Extensions/AzureBlobPayloads/Interceptors/PayloadInterceptor.cs |
Wraps work-item hydration failures with delivery context. |
CHANGELOG.md |
Documents delivery-local hydration failure handling. |
Review effort: Balanced
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.
Summary
What changed?
MoveNextdirectly and recover at the delivery boundary, rather than trying to resume a faultedReadAllAsynciterator. Failed/partially hydrated items are never dispatched.NotFoundlocally and propagate other abandonment failures to connection-level recovery.Why is this change needed?
GetWorkItemsstream, disrupting unrelated healthy work. The fix keeps that same stream open while leaving failed deliveries retryable.Issues / work items
Project checklist
release_notes.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Testing
Automated tests
Dependency restoration (both commands passed using the checked-in feed configuration):
Result: Passed for
netstandard2.0,net6.0,net8.0, andnet10.0, including the changed worker and gRPC dependencies.Result: Passed, 77 tests; 0 failed, 0 skipped.
Result: Passed, 129 tests; 0 failed, 0 skipped. This includes all 34 new loopback cases plus existing payload/history/unary/outbound behavior coverage.
Result: Both passed before committing.
Manual validation (only if runtime/behavior changed)
PayloadStore.NotFoundabandonment. Assert exactly oneGetWorkItemsstream and oneHello, abandonment of only the failed token, and successful completion of both already-running and subsequent healthy activities.NotFoundabandon failures reconnect; shutdown during hydration or abandonment does not reconnect; history/unary hydration failures retain their original exception behavior. Consumer tests also verify heartbeat/retry-counter observation and that partially hydrated/current stale items are never dispatched.Notes for reviewers
NotFoundabandonment failures propagate after the existing gRPC retry policy. Failed payload deliveries remain retryable; terminal poison-payload settlement and changes to other SDKs are outside scope.CHANGELOG.md; no separaterelease_notes.mdor backport was requested.