aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-05-08 19:52:03 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-05-08 19:52:03 -0500
commit12de3c95f155213206bfa3fdc0f680c92c55a59f (patch)
treee964c320b61c87db5062db153262ed4e1770eedd
parent268c9ad92f9700a855d479d91a2e47ff381216f3 (diff)
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) <noreply@anthropic.com>
-rw-r--r--src/src/multiprocess.cpp19
1 files changed, 15 insertions, 4 deletions
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;
}
}