From 12de3c95f155213206bfa3fdc0f680c92c55a59f Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Fri, 8 May 2026 19:52:03 -0500 Subject: multiprocess: silence liveness-probe close as benign primaryAlive() opens a QLocalSocket then disconnects without writing any payload to verify a primary is listening. The primary's receiveMessage() saw the empty PeerClosedError connection and logged "failed to receive data from secondary process" plus a popup, even though the real NXM/shortcut message arrived on the next connection and was processed correctly. Treat zero-byte PeerClosedError/UnknownSocketError closes as the expected probe pattern (debug log, no error). Other errors still report loudly. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/src/multiprocess.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/src/multiprocess.cpp b/src/src/multiprocess.cpp index b22ada3..3ac4c72 100644 --- a/src/src/multiprocess.cpp +++ b/src/src/multiprocess.cpp @@ -172,11 +172,22 @@ void MOMultiProcess::receiveMessage() const auto av = socket->bytesAvailable(); if (av <= 0) { - MOBase::log::error("failed to receive data from secondary process: {}", - socket->errorString()); + // primaryAlive() liveness probes connect then disconnect without sending + // any data — these are expected, not errors. A real secondary that + // failed to deliver its payload will leave a non-PeerClosed error. + const auto err = socket->error(); + const bool isProbe = err == QLocalSocket::PeerClosedError || + err == QLocalSocket::UnknownSocketError; + if (isProbe) { + MOBase::log::debug( + "secondary closed without sending data (liveness probe)"); + } else { + MOBase::log::error("failed to receive data from secondary process: {}", + socket->errorString()); - reportError(tr("failed to receive data from secondary process: %1") - .arg(socket->errorString())); + reportError(tr("failed to receive data from secondary process: %1") + .arg(socket->errorString())); + } return; } } -- cgit v1.3.1