Skip to content

Commit d5d9bf1

Browse files
authored
Merge pull request #327 from jolavillette/fix/pqiperson-start-already-running-noise
fix(pqi): don't restart an already-running peer streamer thread
2 parents b133fb5 + 73ff3f6 commit d5d9bf1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/pqi/pqiperson.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,14 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState,
344344
inConnectAttempt = false;
345345

346346
// STARTUP THREAD
347-
activepqi->start("pqi " + PeerId().toStdString().substr(0, 11));
347+
// On a reconnection over the same interface, activepqi's streamer
348+
// thread is still running: only start it when it isn't, otherwise
349+
// RsThread::start() logs "attempt to start already running thread"
350+
// plus a stack trace on every such reconnection. The already-running
351+
// thread keeps serving the (switched-over) connection, so this is
352+
// purely noise removal and does not change behaviour.
353+
if(!activepqi->isRunning())
354+
activepqi->start("pqi " + PeerId().toStdString().substr(0, 11));
348355

349356
// reset all other children (clear up long UDP attempt)
350357
for(it = kids.begin(); it != kids.end(); ++it)

0 commit comments

Comments
 (0)