Skip to content

Commit

Permalink
Ignore local socket disconnect in initialization state
Browse files Browse the repository at this point in the history
This seems to be a bug in the daemon recovery logic. The initialization
steps starts with a QLocalSocket::abort() to clear the socket state and
this can sometimes generate a disconnect signal, treating disconnection
as an error can result in an infinite loop.
  • Loading branch information
oskirby committed Dec 18, 2024
1 parent 2fddc05 commit 8627161
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/localsocketcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ LocalSocketController::LocalSocketController(const QString& path)
connect(m_socket, &QLocalSocket::connected, this,
&LocalSocketController::daemonConnected);
connect(m_socket, &QLocalSocket::disconnected, this,
[&] { errorOccurred(QLocalSocket::PeerClosedError); });
[&] {
if (m_daemonState != eInitializing) {
errorOccurred(QLocalSocket::PeerClosedError);
}
});
connect(m_socket, &QLocalSocket::errorOccurred, this,
&LocalSocketController::errorOccurred);
connect(m_socket, &QLocalSocket::readyRead, this,
Expand Down

0 comments on commit 8627161

Please sign in to comment.