Skip to content

design/90 block 90a: interrupted teardown wait (R155, R158) - #61

Merged
zacsimile merged 4 commits into
mainfrom
block-90a
Oct 19, 2026
Merged

zacsimile merged 4 commits into
mainfrom
block-90a

Conversation

@zacsimile

Copy link
Copy Markdown
Member

design/90 block 90a. Closes register rows R155 and R158. LOCAL gate: full local suite plus Ubuntu and Windows CI.

R155. In _acquire_with_hooks, a Ctrl-C delivered during the teardown wait now hands teardown to the waiter, just as an expiry does. It writes the pending record and grants the waiter reservation closure, then re-raises. Before this change no pending record was written at all, so the next acquisition was not refused while Acquisition.__exit__ was still running. The wait is on an Event that finish() sets in its outermost finally. _join_acquisition_waiter and 88a's _wait_mda_completion are folded into a single _wait_acquisition_completion. The pending record carries done instead of waiter, and execute_tool reads done.is_set(). Nothing reads is_alive() after an interruptible join any more.

R158. The final displayed(output, 3) check now uses wait_until(..., describe).

Evidence

  • New test test_real_interrupt_hands_blocked_teardown_and_reservation_to_waiter delivers a real _thread.interrupt_main() while the foreground is inside its wait. On the pre-fix tools.py (2e5b7e2) it fails at the refusal: AssertionError: {'ok': True}. With the fix it passed 30 of 30 runs.
  • Full local suite on 7bc7c21's code (macOS, Python 3.12): 5964 passed, 107 skipped, 2 warnings.
  • The other is_alive() sites cannot be reached by a main-thread Ctrl-C. That comes from reading the code, not from measurement, and is tabulated in design/90.

Also in this PR: R159's Importance becomes "recommended before 89b, not required" (operator decision, 2026-10-19).

@zacsimile
zacsimile merged commit bb3e123 into main Oct 19, 2026
2 checks passed
@zacsimile
zacsimile deleted the block-90a branch October 19, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant