PrefectHQ
prefect
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
Fix double-client bug in `flow-run execute` cancellation hooks (#21406) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: alex.s <alex.s@prefect.io> Co-authored-by: alex.s <ajstreed1@gmail.com>
main
7 hours ago
Fix double-client bug in flow-run execute cancellation hooks The CLI 'prefect flow-run execute' code path passed ctx.client as an explicit positional argument to load_flow_from_flow_run, but that function is decorated with @client_injector which already prepends a client. This caused the explicit client to land in the flow_run parameter, resulting in: AttributeError: 'PrefectClient' object has no attribute 'deployment_id' when the Runner tried to load flow code to execute on_cancellation hooks during flow run cancellation. Fix: use a keyword argument so the injected client and flow_run land in the correct parameters: resolve_flow=lambda fr: load_flow_from_flow_run(flow_run=fr) Add regression tests that verify: 1. The fixed pattern correctly routes flow_run and fires hooks 2. The old (broken) pattern triggers a resolution failure warning Closes https://github.com/PrefectHQ/prefect/issues/12714 Co-authored-by: alex.s <alex.s@prefect.io> Co-Authored-By: alex.s <ajstreed1@gmail.com>
devin/1775164810-fix-cancellation-hook-double-client
8 hours ago
Add stale lock recovery via PID check Write the owning process's PID to the lock file on acquisition. When a lock file already exists, read the PID and check if the process is still alive via os.kill(pid, 0). If the process is dead, remove the stale lock and retry immediately — no need to wait for timeout. Co-authored-by: Alexander Streed <desertaxle@users.noreply.github.com> Co-Authored-By: alex.s <ajstreed1@gmail.com>
devin/1775076072-fix-pull-code-race-condition
8 hours ago
Fix flaky tests: SubprocessASGIServer singleton cleanup and SQLite lock retry Fix two flaky test failures from CI workflow run 23918569067: 1. SubprocessASGIServer singleton cache cleanup bug (test_prefect_test_harness): Track the original port used as the _instances dict key via _instance_key, since self.port mutates during start() when an available port is assigned. Previously stop() tried to delete _instances[self.port] (the assigned port) instead of _instances[None] (the original key), leaving stale singleton entries that caused subsequent SubprocessASGIServer() calls to return improperly-initialized instances. 2. SQLite 'database is locked' transient error (test_bulk_delete_flow_runs_no_filter): Wrap the bulk delete request and assertions in retry_asserts to handle transient 503 errors caused by SQLite write lock contention between the test session and the hosted API server subprocess. Co-authored-by: Andrew Katz <andrew@prefect.io> Co-Authored-By: bot_apk <apk@cognition.ai>
devin/1775160319-fix-flaky-tests
10 hours ago
Replace OS-level locking with lock file existence pattern Rewrites _filelock.py to use Path.touch(exist_ok=False) / Path.unlink() instead of fcntl/msvcrt, following the same pattern as FileSystemLockManager. No OS-specific imports needed — works on any platform that supports basic filesystem operations. Co-authored-by: Alexander Streed <desertaxle@users.noreply.github.com> Co-Authored-By: alex.s <ajstreed1@gmail.com>
devin/1775076072-fix-pull-code-race-condition
10 hours ago
Update AGENTS.md files for 9b4f7e9 (#21404) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
main
10 hours ago
Make file locking gracefully degrade on unsupported platforms - Handle ImportError for fcntl/msvcrt so _filelock.py loads on any OS - FileLock.acquire/aacquire silently no-op when locking is unavailable - pull_code() catches lock acquisition failures at runtime and falls back to asyncio.Lock only, logging a debug message Co-authored-by: Alexander Streed <desertaxle@users.noreply.github.com> Co-Authored-By: alex.s <ajstreed1@gmail.com>
devin/1775076072-fix-pull-code-race-condition
10 hours ago
Fix #21401: Handle missing _subprocess_message_processor_factories in ProcessPoolTaskRunner.duplicate() (#21403) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Alexander Streed <ajstreed1@gmail.com>
main
10 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
Fix double-client bug in `flow-run execute` cancellation hooks
#21406
8 hours ago
31619cc
devin/1775164810-fix-cancellation-hook-double-client
CodSpeed Performance Gauge
0%
Fix race condition in `GitRepository.pull_code()` with file-based locking
#21388
8 hours ago
2603ced
devin/1775076072-fix-pull-code-race-condition
CodSpeed Performance Gauge
0%
Fix flaky tests: SubprocessASGIServer singleton cleanup and SQLite lock retry
#21405
10 hours ago
0921155
devin/1775160319-fix-flaky-tests
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs