PrefectHQ
prefect
BlogDocsChangelog

Fix flow run cancellation handling bugs

#20143Merged
Comparing
fix-runner-bugs
(
144f337
) with
main
(
929aab0
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
603.7 µs601.2 µs
bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s

Ignored

bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-5%
33.1 ms34.9 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-45%
9.8 ms17.8 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
+1%
5.8 ms5.8 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
107.7 ms107.8 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
+1%
168.2 ms166.5 ms

Commits

Click on a commit to change the comparison range
Base
main
929aab0
-0.18%
Fix Runner to properly handle flow run cancellation Bug fixes: - Check if flow run is in CANCELLING or CANCELLED state before starting the engine process. If already cancelling, mark it as CANCELLED and exit early. If already cancelled, just exit early without starting the engine. - Fix race condition where _runs_task_group was accessed by FlowRunCancellingObserver before being created. Move task group initialization before the observer. - Fix exit order so client exits after task group, allowing pending tasks to complete their API calls before the client is closed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2d5c9bb
1 day ago
by joshuastagner
-0.03%
Merge branch 'main' into fix-runner-bugs
5abf368
1 day ago
by joshuastagner
-0.14%
Remove extraneous comment
e7d4e9d
1 day ago
by joshuastagner
+0.64%
Merge branch 'main' into fix-runner-bugs
144f337
5 hours ago
by joshuastagner
© 2026 CodSpeed Technology
Home Terms Privacy Docs