mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 18:27:38 +01:00
agentHost: improve update pickup and fix startup-failure wedge (#313541)
- Shorten background update check interval from 24h to 6h so newly published server versions are picked up sooner after auto-shutdown. - Don't store the child into self.running when it exits before signaling ready. Previously a failed startup left a dead child in running forever, wedging ensure_server() so it could never restart the server. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -33,7 +33,7 @@ use crate::util::sync::{new_barrier, Barrier, BarrierOpener};
|
||||
use super::paths::{get_server_folder_name, SERVER_FOLDER_NAME};
|
||||
|
||||
/// How often to check for server updates.
|
||||
pub const UPDATE_CHECK_INTERVAL: Duration = Duration::from_secs(24 * 60 * 60);
|
||||
pub const UPDATE_CHECK_INTERVAL: Duration = Duration::from_secs(6 * 60 * 60);
|
||||
/// How often to re-check whether the server has exited when an update is pending.
|
||||
pub const UPDATE_POLL_INTERVAL: Duration = Duration::from_secs(10 * 60);
|
||||
/// How long to wait for the server to signal readiness.
|
||||
@@ -243,7 +243,10 @@ impl AgentHostManager {
|
||||
if let Some(o) = opener.take() {
|
||||
o.open(Err(format!("Server exited before ready: {e:?}")));
|
||||
}
|
||||
break;
|
||||
// Child has already exited; don't store it in `running`,
|
||||
// otherwise the manager would be wedged with a dead child
|
||||
// forever and ensure_server() would never restart.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,10 +264,6 @@ impl AgentHostManager {
|
||||
});
|
||||
}
|
||||
|
||||
if !ready {
|
||||
return;
|
||||
}
|
||||
|
||||
info!(self.log, "[{}]: Server ready", commit_prefix);
|
||||
|
||||
// Continue reading output until the process exits
|
||||
|
||||
Reference in New Issue
Block a user