Avatar for the PrefectHQ user
PrefectHQ
prefect
BlogDocsChangelog

Fix task run recorder deadlocks using PostgreSQL advisory locks

#18300Closed
Comparing
fix-task-run-recorder-deadlock-advisory-locks
(
6978297
) with
main
(
5486631
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
2
New
0
Dropped
0
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py::bench_import_prefect_flow
CodSpeed Performance Gauge
0%
1.3 s
1.3 s
bench_task_decorator
benches/bench_tasks.py::bench_task_decorator
CodSpeed Performance Gauge
0%
459.8 µs
461.7 µs

Ignored

bench_flow_call[options0]Ignored
benches/bench_flows.py::bench_flow_call[options0]
CodSpeed Performance Gauge
-1%
163.6 ms
164.5 ms
bench_flow_call[options1]Ignored
benches/bench_flows.py::bench_flow_call[options1]
CodSpeed Performance Gauge
+1%
106.3 ms
105.5 ms
bench_flow_decoratorIgnored
benches/bench_flows.py::bench_flow_decorator
CodSpeed Performance Gauge
+2%
4.3 ms
4.2 ms
bench_import_prefectIgnored
benches/bench_import.py::bench_import_prefect
CodSpeed Performance Gauge
0%
2.7 ms
2.7 ms
bench_task_callIgnored
benches/bench_tasks.py::bench_task_call
CodSpeed Performance Gauge
-3%
160.4 ms
165.4 ms
bench_task_submitIgnored
benches/bench_tasks.py::bench_task_submit
CodSpeed Performance Gauge
-12%
5.2 ms
5.9 ms

Commits

Click on a commit to change the comparison range
Base
main
5486631
0%
Fix type hint and Python 3.9/3.10 compatibility - Add missing type hint for flow parameter (orm_models.Flow) - Replace asyncio.Barrier with custom SimpleBarrier implementation for Python 3.9/3.10 compatibility - Import orm_models for proper type annotation
acf5275
1 day ago
by zzstoatzz
0%
Update test_task_run_recorder_handles_concurrent_inserts to use SimpleBarrier Replace the two asyncio.Event objects with SimpleBarrier for cleaner and more consistent synchronization. This simplifies the test and makes it use the same pattern as other concurrent tests.
80f7e57
1 day ago
by zzstoatzz
0%
Update duplicate event test for advisory lock behavior The test now verifies that duplicate events are handled gracefully without causing server overload. With advisory locks: - Concurrent duplicates are skipped rather than causing errors - Sequential duplicates may go to dead letter queue - No infinite retry loops occur (fixes #15607) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
6978297
1 day ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs