Skip to content

fix(pqi): don't restart an already-running peer streamer thread#327

Open
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/pqiperson-start-already-running-noise
Open

fix(pqi): don't restart an already-running peer streamer thread#327
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/pqiperson-start-already-running-noise

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

fix(pqi): don't restart an already-running peer streamer thread

pqiperson::handleNotifyEvent_locked() unconditionally calls activepqi->start() on CONNECT_SUCCESS. When a peer reconnects over the same interface, the streamer thread (pqithreadstreamer, an RsThread) is still running, so RsThread::start() hits its "already running" guard and logs attempt to start already running thread: pqi <peer> followed by a full stack trace, on every such reconnection.

This is purely noise: start() was already failing (returning false), so the thread was never actually restarted; pqissl switches the socket over underneath the running streamer. Guard the call with RsThread::isRunning() so it is only (re)started when actually stopped. Behaviour is unchanged; only the spurious error + stack trace are gone.

pqiperson::handleNotifyEvent_locked() unconditionally calls
activepqi->start() on CONNECT_SUCCESS. When a peer reconnects over the
same interface, the streamer thread (pqithreadstreamer, an RsThread) is
still running, so RsThread::start() hits its "already running" guard and
logs `attempt to start already running thread: pqi <peer>` followed by a
full stack trace, on every such reconnection.

This is purely noise: start() was already failing (returning false), so
the thread was never actually restarted; pqissl switches the socket over
underneath the running streamer. Guard the call with
RsThread::isRunning() so it is only (re)started when actually stopped.
Behaviour is unchanged; only the spurious error + stack trace are gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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