PrefectHQ
prefect
BlogDocsChangelog

Fix `FileExistsError` in runner temp directory creation

#18864Merged
Comparing
fix-runner-temp-dir-race-condition
(
6357333
) with
main
(
59acba2
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
456.8 µs458.1 µs

Ignored

bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-2%
165.6 ms168.8 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
2.7 ms2.7 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-15%
4.6 ms5.4 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
105.9 ms105.9 ms
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-2%
175.8 ms180.1 ms
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-11%
4.2 ms4.7 ms

Commits

Click on a commit to change the comparison range
Base
main
59acba2
-0.04%
Fix FileExistsError in runner temp directory creation This PR addresses a race condition that could occur when multiple runners or workers attempt to create the same temporary directory simultaneously. Changes: - Make temp directory creation idempotent with exist_ok=True - Make cleanup more tolerant with ignore_errors=True - Add graceful shutdown for workers in run-once mode by tracking active run tasks - Ensure workers wait for submitted runs to complete before teardown This prevents the FileExistsError that was occurring when running deployments with process workers, particularly in rapid succession or concurrent scenarios. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
2654474
1 month ago
by zzstoatzz
-0.02%
Merge branch 'main' into fix-runner-temp-dir-race-condition
0519a63
30 days ago
by zzstoatzz
-0.04%
docs: refresh api ref anchors after worker changes (auto-generated)
6357333
30 days ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs