Skip to content

indy: make a stalled replication join name the loop it is waiting for (#564) - #568

Merged
ohohoreilly merged 1 commit into
masterfrom
ohohoreilly/564-name-the-wedged-loop
Sep 18, 2026
Merged

ohohoreilly merged 1 commit into
masterfrom
ohohoreilly/564-name-the-wedged-loop

Conversation

@ohohoreilly

Copy link
Copy Markdown
Member

indy: make a stalled replication join name the loop it is waiting for (#564)

GracefulShutdownUnresponsiveSlave wedges on aarch64 about one CI run in
eighteen. The wedge is in JoinReplicationServices(), which pops a blocking
semaphore once per replication loop that started -- so one loop that never
returns hangs shutdown forever, silently. The only syslog between the
connection drain and "TServer::Shutdown() complete" is the drain's own
deadline warning, so from the log a wedge here is indistinguishable from a
wedge anywhere else in Shutdown(), and the process is dead by the time anyone
reads CI.

83 attempts across four harnesses failed to reproduce it locally or on demand
in CI, so waiting for a reproduction is not a plan. Make the first natural
occurrence diagnose itself instead.

Each loop now sets a bit on entry and clears it on exit, alongside the
existing started-count and Exited push -- one RAII latch doing all three, so
every exit path stays covered including the exceptional ones the loops rely
on. The join polls the semaphore's fd rather than blocking on it outright,
and every 15s of no progress logs which loops have still not returned.

The wait stays unbounded on purpose. The teardown that follows frees the very
fds and collections a still-parked loop references (#440); giving up would
trade a hang for a use-after-free. Nothing about the shutdown contract
changes -- this only removes the silence.

Verified by injecting a 35s stall into RunReplicationWork: the report fires at
15s and 30s naming [RunReplicationWork], shutdown still completes afterwards,
and the fixture still passes 2/2. Without the injection there are no warnings
at all and both fixtures pass, so a healthy shutdown stays quiet.

…#564)

GracefulShutdownUnresponsiveSlave wedges on aarch64 about one CI run in
eighteen. The wedge is in JoinReplicationServices(), which pops a blocking
semaphore once per replication loop that started -- so one loop that never
returns hangs shutdown forever, silently. The only syslog between the
connection drain and "TServer::Shutdown() complete" is the drain's own
deadline warning, so from the log a wedge here is indistinguishable from a
wedge anywhere else in Shutdown(), and the process is dead by the time anyone
reads CI.

83 attempts across four harnesses failed to reproduce it locally or on demand
in CI, so waiting for a reproduction is not a plan. Make the first natural
occurrence diagnose itself instead.

Each loop now sets a bit on entry and clears it on exit, alongside the
existing started-count and Exited push -- one RAII latch doing all three, so
every exit path stays covered including the exceptional ones the loops rely
on. The join polls the semaphore's fd rather than blocking on it outright,
and every 15s of no progress logs which loops have still not returned.

The wait stays unbounded on purpose. The teardown that follows frees the very
fds and collections a still-parked loop references (#440); giving up would
trade a hang for a use-after-free. Nothing about the shutdown contract
changes -- this only removes the silence.

Verified by injecting a 35s stall into RunReplicationWork: the report fires at
15s and 30s naming [RunReplicationWork], shutdown still completes afterwards,
and the fixture still passes 2/2. Without the injection there are no warnings
at all and both fixtures pass, so a healthy shutdown stays quiet.
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