Skip to content

fix(console): join rx_thread in stop() before returning - #610

Merged
chombourger merged 1 commit into
siemens:nextfrom
chombourger:ch/fix/join-console-rx-thread-in-stop
Aug 25, 2026
Merged

fix(console): join rx_thread in stop() before returning#610
chombourger merged 1 commit into
siemens:nextfrom
chombourger:ch/fix/join-console-rx-thread-in-stop

Conversation

@chombourger

Copy link
Copy Markdown
Collaborator

ConsoleOutput.stop() only flipped exiting=True; the rx thread it started in start() could still be alive well after stop() returned, since nothing ever joined it. For RemoteConsole, that thread blocks on a streaming RPC's grpc channel -- a caller that treats stop() as "the channel is gone" and forks right after races grpc-core's own thread pool, which won't report idle to that fork while the channel is still mid-teardown, and stalls with "Waiting for thread pool to idle before forking".

ConsoleOutput gains join(timeout=None), and RemoteConsole.stop() calls it after cancelling its stream and closing its channel, so stop() doesn't return until the thread has actually exited.

ConsoleOutput.stop() only flipped exiting=True; the rx thread it
started in start() could still be alive well after stop() returned,
since nothing ever joined it. For RemoteConsole, that thread blocks on
a streaming RPC's grpc channel -- a caller that treats stop() as "the
channel is gone" and forks right after races grpc-core's own thread
pool, which won't report idle to that fork while the channel is still
mid-teardown, and stalls with "Waiting for thread pool to idle before
forking".

ConsoleOutput gains join(timeout=None), and RemoteConsole.stop() calls
it after cancelling its stream and closing its channel, so stop()
doesn't return until the thread has actually exited.

Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
@chombourger
chombourger merged commit d940132 into siemens:next Aug 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants