This repository was archived by the owner on Jul 5, 2026. It is now read-only.
Commit aa1baf8
committed
fix(actions): set ActionManager._ongoing_actions_finished_event at init
``ActionManager.__init__`` set ``_ongoing_actions_count = 0`` and built
``_ongoing_actions_finished_event = asyncio.Event()``, which defaults to
the clear state. This violates the natural invariant *count=0 ↔ event
set*: an immediate ``await event.wait()`` blocks forever even though no
action is in flight.
The counter helpers (``_increment_ongoing_actions_count`` /
``_decrement_ongoing_actions_count``) flip the event correctly on
transition, so the only buggy state was the initial one. Set the event
at init time to restore the invariant; behaviour from the first action
onward is unchanged.
Reproducer: ``await ActionManager(worker, mgr)._ongoing_actions_finished_event.wait()``
hung forever pre-fix; returns immediately post-fix. Added a regression
test pinning both ``count == 0`` and ``event.is_set()`` at init plus a
``wait_for(..., timeout=0.1)`` that exercises the path.1 parent 080d1d9 commit aa1baf8
3 files changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
| 106 | + | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
78 | 96 | | |
79 | 97 | | |
80 | 98 | | |
| |||
0 commit comments