Avatar for the PrefectHQ user
PrefectHQ
prefect
BlogDocsChangelog

Fixes async locking error by generating unique holder for each transaction

#18607
Comparing
fix-async-locking-error
(
0883d88
) with
main
(
b6f64e4
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
2
New
0
Dropped
0
Ignored
6

Benchmarks

Passed

bench_task_decorator
benches/bench_tasks.py::bench_task_decorator
CodSpeed Performance Gauge
0%
458.9 µs
457.9 µs
bench_import_prefect_flow
benches/bench_import.py::bench_import_prefect_flow
CodSpeed Performance Gauge
0%
1.4 s
1.4 s

Ignored

bench_flow_call[options0]Ignored
benches/bench_flows.py::bench_flow_call[options0]
CodSpeed Performance Gauge
+4%
173.2 ms
166.3 ms
bench_flow_call[options1]Ignored
benches/bench_flows.py::bench_flow_call[options1]
CodSpeed Performance Gauge
+3%
108.3 ms
105.7 ms
bench_flow_decoratorIgnored
benches/bench_flows.py::bench_flow_decorator
CodSpeed Performance Gauge
+25%
4.6 ms
3.6 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
-5%
162 ms
171.4 ms
bench_task_submitIgnored
benches/bench_tasks.py::bench_task_submit
CodSpeed Performance Gauge
+30%
7.7 ms
5.9 ms

Commits

Click on a commit to change the comparison range
Base
main
b6f64e4
0%
Fixes async locking error by generating unique holder for each transaction These changes fix an error where running nested transactions across asyncio tasks caused an error when releasing a transactions lock. The default holder string contains the ID of the current task, so mixing tasks would result in mismatched holders on lock acquisition and release. The fix is to generate a unique holder for each transaction, which is used to acquire and release the lock, and held for the duration of the transaction. Closes https://github.com/PrefectHQ/prefect/issues/18600
05a2a47
2 days ago
by desertaxle
+1%
What `breakpoint()`?
0883d88
2 days ago
by desertaxle
© 2025 CodSpeed Technology
Home Terms Privacy Docs