Skip to content

Abandon workitem if processing workitem failed #467

Merged
YunchuWang merged 4 commits into
mainfrom
wangbill/abandon
Sep 17, 2025
Merged

Abandon workitem if processing workitem failed #467
YunchuWang merged 4 commits into
mainfrom
wangbill/abandon

Conversation

@YunchuWang

Copy link
Copy Markdown
Member

This pull request improves the error handling and logging for background task processing in the gRPC worker, ensuring that when an error occurs, the system properly abandons the relevant work item and logs the process for orchestrator, activity, and entity work items. It also introduces comprehensive tests to verify the new logging behavior.

Enhanced error handling and logging:

  • Added logic to RunBackgroundTask in GrpcDurableTaskWorker.Processor to explicitly abandon orchestrator, activity, and both versions of entity work items when an error occurs, with detailed logging for each step. Throws an exception if the work item type is unknown.
  • Introduced new logger messages in Logs.cs for "abandoning" and "abandoned" states for orchestrator, activity, and entity work items, each with distinct event IDs and message formats.

Testing improvements:

  • Added a new test suite RunBackgroundTaskLoggingTests that verifies the correct logging and abandonment behavior for orchestrator, activity, and both versions of entity work items when errors are encountered during background task processing.

Comment thread src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs Outdated
Comment thread src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs Outdated
Comment thread src/Worker/Grpc/GrpcDurableTaskWorker.Processor.cs Outdated
@YunchuWang
YunchuWang merged commit 7396675 into main Sep 17, 2025
4 checks passed
@YunchuWang
YunchuWang deleted the wangbill/abandon branch September 17, 2025 15:05
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