Repository navigation
fix(odin): Report the real outcome of Start and Stop task actions (EDG-1035) - #591
Draft
vikramlc-cognite wants to merge 1 commit into
Draft
vikramlc-cognite wants to merge 1 commit into
vikramlc-cognite wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'completed_with_errors' action status for tasks and improves the reporting of task outcomes. It adds an 'ErrorSummary' class to track errors during task execution, allowing 'Start ' actions to report more accurate statuses (failed, completed_with_errors, or succeeded) based on reported errors. Additionally, it updates 'Stop ' actions to wait for the task to finish before reporting success, with a configurable timeout. There are no review comments to address.
vikramlc-cognite
marked this pull request as draft
October 26, 2026 10:22
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## EDG-1033-clean-shutdown #591 +/- ##
===========================================================
+ Coverage 84.93% 85.25% +0.31%
===========================================================
Files 46 46
Lines 4819 4882 +63
===========================================================
+ Hits 4093 4162 +69
+ Misses 726 720 -6
🚀 New features to boost your workflow:
|
Start <task> now maps the errors reported on the TaskContext to the action status (failed / completed_with_errors / succeeded), and Stop <task> stays running until the task has ended. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
vikramlc-cognite
force-pushed
the
EDG-1035-action-outcome-status
branch
from
November 2, 2026 12:00
5b694dc to
370f43a
Compare
This branch has not been deployed
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
Start <task>now reports how the run actually went (failed,completed_with_errors,succeeded), andStop <task>reportssucceededonly once the task has ended.Type of change
What changed
tasks.py: thread-safeErrorSummaryonTaskContext, recording the count and first description/details perErrorLevel.base.py_start_task_outcome(rule, in this order): cancelled ->canceled; anyfatalerror or a raising task ->failedwith the first fatal error's description and details asresultMessage(truncated); else anyerror-level error ->completed_with_errors("Completed with N error(s): "); elsesucceeded(warnings only or nothing).Stop <task>: reportsrunning, waits until the task has ended, thensucceeded.failedif the task is idle ("not currently running") or has not ended withinSTOP_TASK_ACTION_TIMEOUT_SECONDS(300 s);canceledif the Stop itself is cancelled (shutdown, user)._dto.py:ActionStatus.completed_with_errors. Module docstring documents the rule; CHANGELOG.Why it changed
succeeded(DBbroken-query, File with a missing source). Stop reportedsucceededas soon as the signal was sent.completed_with_errors(cognitedata/odin#324).What to focus on during review
error, so until it reports it as fatal (follow-up in db-extractor) it endscompleted_with_errors, notfailed.Test evidence
tests/test_unstable/test_action_outcome.py: 14 tests (fatal, truncation, error-only,ctx.exception, warning-only, none, raising task, cancel, scheduled run, Stop waits, Stop timeout, Stop idle, Stop on shutdown)uv run pytest tests/test_unstable: 300 passed; the same 1 failed + 48 environment errors asmasterruff,ruff format,mypy,pre-commit run --all-filespassbase.py/tasks.pyreverted; the other 5 guard unchanged behaviourRisks and unknowns
succeeded.completed_with_errors(Add status codes to time series queue #324), a check-in carrying it may be rejected. Deploy Odin first.runningin Odin for up to 300 s.Rollout and rollback
Checklist