fix: preserve export progress statistics on batch failure#313
Open
YunchuWang wants to merge 1 commit into
Open
fix: preserve export progress statistics on batch failure#313YunchuWang wants to merge 1 commit into
YunchuWang wants to merge 1 commit into
Conversation
… batch failure When a batch of export activities fails after exhausting all retry attempts, the orchestrator commits a checkpoint with scannedInstances=0 and exportedInstances=0. This discards the actual work done: the number of instances that were scanned and the number that were successfully exported before the batch was marked as failed. The entity accumulates these counters via addition, so reporting 0 means the job's progress statistics undercount the real work, giving operators inaccurate progress data. Fix: Use the actual scannedCount and batchResult.exportedCount values in the failure-path checkpoint, matching the success-path behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes progress reporting in the export-history job orchestrator so that, when an export batch ultimately fails (after exhausting the batch-level retry loop), the job’s checkpoint still records the actual scanned/exported counts and preserves failure details. This aligns failure-path checkpointing behavior with the success path and addresses the incorrect “0/0 progress” reporting described in issue #213.
Changes:
- Update failure-path checkpoint commits to use
scannedCountandbatchResult.exportedCountinstead of hardcoded zeros. - Add regression tests that validate checkpoint counts for partial-batch failures, full-batch failures, and successful batches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/durabletask-js-export-history/src/orchestrators/export-job-orchestrator.ts | Fixes failure-path checkpointing to persist actual scanned/exported counts alongside failure details. |
| packages/durabletask-js-export-history/test/export-job-orchestrator.spec.ts | Adds regression coverage to ensure progress statistics are preserved on batch failure and correct on success. |
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
Fixes #213
Testing
npm test -w @microsoft/durabletask-js-export-history -- --runTestsByPath test/export-job-orchestrator.spec.tsnpm run build -w @microsoft/durabletask-js-export-history