Fix Data Management step badges stuck on running for finished steps - #1296
Merged
Paul Lizer (paullizer) merged 2 commits intoAug 19, 2026
Merged
Conversation
Fixes microsoft#1272 Completed job steps showed a "running" badge on the Data Management job timeline, and finished backup jobs still displayed "Current container: Waiting". Together these made a completed job look stuck. _set_job_progress used one status value for two different things: the job document and the timeline event it recorded. Every call site announcing a finished step relied on the default DATA_MANAGEMENT_STATUS_RUNNING, so "Cosmos DB export step completed" was recorded as running. The event was historically accurate, but the timeline presents that badge as the step's own state, and there was no way to express "this step is done, the job is not" because both shared one field. Add a step_status parameter that governs only the recorded event, plus a _complete_job_step helper, and move the 15 step-completion call sites onto it across backup, restore, and migration. step_status defaults to None and falls back to status, so untouched call sites keep their behavior: steps that start still report running, and genuinely terminal calls such as "Restore completed" still propagate their terminal status to both the job and the event. Also correct four migration outcome events recorded directly through _record_data_management_job_event (migration-plan, migration-preflight, migration-cosmos-{target_type}, migration-reconciliation) which describe finished work but were stamped running. The "queued" half of the report was not a defect. Every event call site passes an explicit status, so the queued default is never stranded on a step; the queued and *-retry-queued entries genuinely describe queueing. On the frontend, add isTerminalJobStatus and gate live-only telemetry so finished jobs stop rendering "Current container: Waiting" and migration "Liveness: Running". Cumulative metrics still render on finished jobs. Validation: 18 passed in the new step status suite; 175 passed across Data Management with only the two known pre-existing issues. Regression probe reverting step_status fails with "assert 'running' == 'completed'".
Resolves conflicts introduced by PR microsoft#1295 (Backup Inventory GROUP BY fix) landing on Development first. - config.py: keep 0.260.003, which supersedes the 0.260.002 from microsoft#1295. - release_notes.md: keep both sections, newest first (0.260.003 above 0.260.002). Neither entry replaces the other. functions_data_management.py auto-merged cleanly; the two changes touch different regions (_count_data_management_backups vs _set_job_progress / _complete_job_step) and both are present after the merge. Validation: 177 passed across the Data Management suite, with only the two known pre-existing issues (swagger_wrapper collection error in test_admin_endpoint.py, and test_backup_recovery_and_admin_progress_are_bounded_and_sanitized).
Paul Lizer (paullizer)
merged commit Aug 19, 2026
fa5b1c2
into
microsoft:Development
10 of 11 checks passed
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.
Fixes #1272
Related: #1258, #1271, #1276 (all merged/closed).
Problem
On a finished Data Management job the details panel misrepresented state twice:
Cosmos DB export step completed,AI Search export step completed,Source blob export step completed— still showed arunningbadge.completed_with_warnings.Together these made a completed job look stuck. The history read as "queued → running → complete" at the job level while individual steps never advanced past
running.Root Cause
_set_job_progress()used a singlestatusvalue for two different things — the job document and the timeline event it recorded:Every call site announcing a finished step relied on the default
DATA_MANAGEMENT_STATUS_RUNNING:The event was historically accurate — the job was running when the step finished — but the timeline presents that badge as the step's state. There was no way to express "this step is done, the job is not" because both shared one field.
Four migration events recorded directly through
_record_data_management_job_eventhad the same defect:migration-plan,migration-preflight,migration-cosmos-{target_type},migration-reconciliationall describe finished work but were stampedrunning.The
queuedhalf of the report was not a defect. Every event call site passes an explicit status, so thequeueddefault on_record_data_management_job_eventis never stranded on a step — thequeuedand*-retry-queuedentries genuinely describe queueing actions.Changes
functions_data_management.pystep_statusparameter to_set_job_progressthat governs only the recorded timeline event, plus a_complete_job_stephelper.running.step_statusdefaults toNoneand falls back tostatus, so untouched call sites keep their behavior: steps that start still reportrunning, and genuinely terminal calls such asRestore completedstill propagate their terminal status to both the job and the event.admin_data_management.js— addedisTerminalJobStatusand gated live-only telemetry. Finished jobs stop rendering Current container: Waiting and migration Liveness: Running. Cumulative metrics (processed, transferred, request units, retries, skipped/failed) still render.Resulting per-step lifecycle:
runningwhen a step begins,completedwhen it finishes, while the job staysrunninguntil it actually completes.Validation
functional_tests/test_data_management_job_step_status.py— 18 passed (new file)-k data_management) — 175 passed, only the two known pre-existing issues (swagger_wrappercollection error intest_admin_endpoint.py, andtest_backup_recovery_and_admin_progress_are_bounded_and_sanitized)Regression probe: reverting
status=step_status or statusback tostatus=statusfailstest_finished_step_is_completed_while_job_keeps_runningwithAssertionError: assert 'running' == 'completed', confirming the test fails for the right reason.Impact
Cosmos DB export step completedrunningcompletedAI Search export step completedrunningcompletedSource blob export step completedrunningcompletedMigration reconciliation completedrunningcompletedMigrating Cosmos records)runningrunningrunningrunningWaitingRunning - ...Note on versioning
This branch bumps to
0.260.003. PR #1295 (Backup Inventory) bumps to0.260.002from the same base, soconfig.pyand the top ofrelease_notes.mdwill conflict trivially if both merge — resolve by keeping both sections.