gui: disable retry on agent connections, let reconcile manage lifecycle

Agent connections no longer retry on their own. When an agent is
killed, the connection goes to Disconnected and stays there.
reconcileAgentConnections (triggered by refreshSessions) is the
sole authority for creating/removing connections.

For the happy path (probe returns normally), the connection
immediately re-probes without a timer delay.
This commit is contained in:
Levi Neely 2026-08-03 11:33:41 +02:00
parent 379afd81bf
commit 0352d3a046
2 changed files with 9 additions and 5 deletions

View File

@ -92,10 +92,13 @@ void NinePConnection::onFinished(int exitCode, QProcess::ExitStatus)
m_process->deleteLater();
m_process = nullptr;
if (m_probe && m_state == Connected && m_openMarkerSeen && exitCode == 0 && !m_stopRequested) {
if (m_retryMs > 0)
m_retryTimer.start(m_retryMs);
else
startProcess(); // immediate re-probe
return;
}
if (m_stopRequested) {
if (m_stopRequested || m_retryMs <= 0) {
setState(Disconnected);
return;
}

View File

@ -254,10 +254,11 @@ void Ollie9pClient::reconcileAgentConnections()
// rather than showing a transient red indicator.
refreshSessions();
});
// Use immutable IDs in path — aliases in the 9P namespace resolve
// these to the correct session/agent regardless of display name.
// No retry — reconcileAgentConnections is the authority for
// connection lifecycle. If the agent is still alive after refresh,
// reconcile will create a new connection.
connection->start(ollie9pBin(), {"-a", serverAddr(), "read", "--open-marker",
"session/" + sid + "/agent/" + aid + "/connection"}, 4000, true);
"session/" + sid + "/agent/" + aid + "/connection"}, 0, true);
}
}
for (auto it = m_agentConnections.begin(); it != m_agentConnections.end();) {