Skip to content

feat(odin): Report action status updates promptly (EDG-1036) - #589

Draft
vikramlc-cognite wants to merge 1 commit into
EDG-1032-checkin-resiliencefrom
EDG-1036-prompt-action-status
Draft

vikramlc-cognite wants to merge 1 commit into
EDG-1032-checkin-resiliencefrom
EDG-1036-prompt-action-status

Conversation

@vikramlc-cognite

Copy link
Copy Markdown
Contributor

Summary

Action status updates (running and the final status) are sent to the Integrations API about a second after they are queued, instead of on the next 30 s check-in.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor (no functional change)
  • Documentation update
  • Chore / tooling / CI

What changed

  • checkin_worker.py: queue_action_update wakes the periodic check-in loop; the loop waits a debounce (ACTION_UPDATE_DEBOUNCE_SECONDS = 1.0) and then flushes, so a burst of updates causes one extra check-in.
  • The wake-up uses a child CancellationToken of the loop token, so real cancellation still wins and nothing is held under _lock or _flush_lock. It is dropped and recreated in __getstate__/__setstate__ so the worker stays picklable.
  • Cadence is unchanged when no update is queued. Tests in tests/test_unstable/test_early_checkin.py; CHANGELOG.

Why it changed

  • running only reached Odin on the check-in after the work started, so actions showed pending for up to 30 s while already running, short actions never showed running, and final statuses lagged about 30 s.
  • Related issue: EDG-1036 (parent: EDG-1031)
  • Related docs / discussion: actions bug bash finding Configurable log level in uploaders #8. Stacked on EDG-1032 (previous PR in this stack).

What to focus on during review

  • Locking: the wake token is cancelled outside _lock, and the loop creates it before each flush.
  • That cancellation during the debounce is honoured.

Test evidence

  • tests/test_unstable/test_early_checkin.py: 5 tests (early check-in within the debounce window, a burst of 50 updates gives one extra check-in, no update gives none, cancellation, queueing before the loop starts); run 3 times with no flakes
  • uv run pytest tests/test_unstable: same 1 failed + 48 environment errors as master; passed count 274 -> 279
  • ruff, mypy, pre-commit run --all-files pass
  • 4 of 5 tests fail with the production change reverted

Risks and unknowns

  • An update queued during a flush can cause one spurious extra check-in (bounded by the debounce).
  • The tests are timing based.

Rollout and rollback

  • No config changes. Revert the commit to roll back.

Checklist

  • Self-reviewed the diff
  • Tests added or updated (or N/A with reason)
  • Docs updated (or N/A): CHANGELOG
  • No secrets, credentials, or PII committed
  • Breaking changes called out above and communicated to affected teams: none

@vikramlc-cognite
vikramlc-cognite requested a review from a team as a code owner October 26, 2026 09:16

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a debounced early check-in mechanism for action status updates in the unstable package. Instead of waiting for the next periodic check-in, queuing an action update now wakes the check-in loop early after a short debounce interval (1 second by default), allowing bursts of updates to be sent together. This is implemented using a child cancellation token (_wake_token) in CheckinWorker. A comprehensive suite of unit tests has been added to verify this behavior. There are no review comments, and I have no feedback to provide.

@vikramlc-cognite
vikramlc-cognite marked this pull request as draft October 26, 2026 10:22
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.75%. Comparing base (90affef) to head (7e3937f).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           EDG-1032-checkin-resilience     #589      +/-   ##
===============================================================
+ Coverage                        84.70%   84.75%   +0.04%     
===============================================================
  Files                               46       46              
  Lines                             4746     4761      +15     
===============================================================
+ Hits                              4020     4035      +15     
  Misses                             726      726              
Files with missing lines Coverage Δ
...ite/extractorutils/unstable/core/checkin_worker.py 98.49% <100.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Queuing an action update now wakes the periodic check-in loop, which checks in
after a 1s debounce instead of waiting for the next 30s interval.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@vikramlc-cognite
vikramlc-cognite force-pushed the EDG-1036-prompt-action-status branch from ec0e902 to 7e3937f Compare November 2, 2026 12:00

This branch has not been deployed

No deployments
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