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:
parent
379afd81bf
commit
0352d3a046
|
|
@ -92,10 +92,13 @@ void NinePConnection::onFinished(int exitCode, QProcess::ExitStatus)
|
||||||
m_process->deleteLater();
|
m_process->deleteLater();
|
||||||
m_process = nullptr;
|
m_process = nullptr;
|
||||||
if (m_probe && m_state == Connected && m_openMarkerSeen && exitCode == 0 && !m_stopRequested) {
|
if (m_probe && m_state == Connected && m_openMarkerSeen && exitCode == 0 && !m_stopRequested) {
|
||||||
m_retryTimer.start(m_retryMs);
|
if (m_retryMs > 0)
|
||||||
|
m_retryTimer.start(m_retryMs);
|
||||||
|
else
|
||||||
|
startProcess(); // immediate re-probe
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_stopRequested) {
|
if (m_stopRequested || m_retryMs <= 0) {
|
||||||
setState(Disconnected);
|
setState(Disconnected);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -254,10 +254,11 @@ void Ollie9pClient::reconcileAgentConnections()
|
||||||
// rather than showing a transient red indicator.
|
// rather than showing a transient red indicator.
|
||||||
refreshSessions();
|
refreshSessions();
|
||||||
});
|
});
|
||||||
// Use immutable IDs in path — aliases in the 9P namespace resolve
|
// No retry — reconcileAgentConnections is the authority for
|
||||||
// these to the correct session/agent regardless of display name.
|
// connection lifecycle. If the agent is still alive after refresh,
|
||||||
|
// reconcile will create a new connection.
|
||||||
connection->start(ollie9pBin(), {"-a", serverAddr(), "read", "--open-marker",
|
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();) {
|
for (auto it = m_agentConnections.begin(); it != m_agentConnections.end();) {
|
||||||
|
|
|
||||||
Reference in New Issue