about summary refs log tree commit diff
path: root/test/python/test_mapping_methods.py
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-08 13:45:50 +0000
committerPjotr <wrk@bosa.lan>2026-11-08 13:45:50 +0000
commit1f76ef2ef19ae36882236be7c016f0ab98d31f11 (patch)
treeb9c1e479560ca48631592e212adea87cb893e995 /test/python/test_mapping_methods.py
parent875d680a9c3cfe7f3b5a92f86ce211b5a5dfcbb4 (diff)
downloadgenenetwork4-1f76ef2ef19ae36882236be7c016f0ab98d31f11.tar.gz
compute_gate: undo the claim if the wait for the slot is cancelled
`claim()` inserts the subject into `claimants` and *then* awaits the
permit, and that await is cancellable: a client disconnect while queued
dropped the handler's future with the entry still in the set, so that
subject was refused `compute_busy` for the life of the process. The
reservation guard removes the entry when the wait is cancelled, and hands
ownership to the `Claim` once the permit arrives -- the slot itself was
never leaked (no permit had been taken), only the subject's name.

Found by asking what could race; the new test fails without the guard
(verified by disabling it) and passes with it.

* src/compute_gate.rs (Reservation): the entry's owner from insertion to
permit, `hand_over()` at the hand-off.
(Drop for Claim): field order is load-bearing -- the maps are cleaned
before `_permit` is released, so the next waiter cannot see a stale
entry or a stale `running` record; and take the locks poisoned-tolerant
(`lock_recover`) rather than silently skipping the cleanup.
(tests): `a_cancelled_waiter_does_not_wedge_its_subject`.
Diffstat (limited to 'test/python/test_mapping_methods.py')
0 files changed, 0 insertions, 0 deletions