Repository navigation
fix(chatflow): cancel watchdog on workflow terminal events - #45029
Conversation
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45029 +/- ##
=======================================
Coverage 59.62% 59.62%
=======================================
Files 6011 6011
Lines 377116 377116
Branches 76358 76358
=======================================
+ Hits 224848 224852 +4
+ Misses 146276 146271 -5
- Partials 5992 5993 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
MRZHUH
left a comment
There was a problem hiding this comment.
Reviewed f077a7e. No blocking correctness issues found. All three workflow terminal events now enter the existing cleanup path after enqueueing the event, cancelling the watchdog while preserving pause and response-detachment behavior. The downstream handlers still produce the final responses directly, and the regression tests exercise real Timer cancellation and thread exit.
Validation: CI API unit tests (24,293 passed, 4 skipped), controller and integration tests, Python style, and Pyrefly checks passed. codecov/patch also passed. Local tests were not rerun for this review.
Outstanding CI caveat: codecov/project is still failing (56.89% versus 59.62% on the base). This approval covers the code change; the aggregate coverage failure still needs resolution before merge.
Summary
Chatflow success, partial success and failure could finish the response pipeline while leaving the execution coordinator RUNNING. Its watchdog then retained the queue and task context until the execution timeout.
Handle all three workflow terminal events through the existing terminal cleanup path, marking the coordinator TERMINAL and cancelling its watchdog. Pause and response-detachment behavior are preserved.
Related: INF-438.
Validation
threading.Timercancellation and thread exit.Dev validation does not cover broker scheduling or high worker concurrency. The patch has not been deployed to shared workers; releasing these references does not guarantee an immediate RSS decrease.
Screenshots
N/A — backend execution lifecycle fix.
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint godsFrom Codex