Skip to content

relay: make stop() idempotent and keep context_ alive during teardown#372

Merged
afrind merged 1 commit into
mainfrom
fix/relay-stop
Jun 1, 2026
Merged

relay: make stop() idempotent and keep context_ alive during teardown#372
afrind merged 1 commit into
mainfrom
fix/relay-stop

Conversation

@afrind
Copy link
Copy Markdown
Contributor

@afrind afrind commented Jun 1, 2026

Guard stop() with a stopped_ flag instead of context_ presence, and stop resetting context_. terminateClientSession can run after stop() returns, from handleClientSession coroutines still draining on the evb/IO threads, so context_ must outlive stop().

Calling stop with active sessions could lead to a null ptr deref on context_.


This change is Reviewable

Guard stop() with a stopped_ flag instead of context_ presence, and stop
resetting context_. terminateClientSession can run after stop() returns,
from handleClientSession coroutines still draining on the evb/IO threads,
so context_ must outlive stop().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@gmarzot gmarzot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmarzot reviewed 4 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on akash-a-n, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

@afrind afrind merged commit 5a8c3d5 into main Jun 1, 2026
16 checks passed
@afrind afrind deleted the fix/relay-stop branch June 1, 2026 22:26
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.

2 participants