Compare commits
25 Commits
v0.12.3-de
...
codenomad/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afc554ef98 | ||
|
|
46150cda5e | ||
|
|
0874f78ccf | ||
|
|
88da377795 | ||
|
|
3533dabda0 | ||
|
|
25555ed42c | ||
|
|
df6c96453f | ||
|
|
db3a786b48 | ||
|
|
1e47389df3 | ||
|
|
d7ae575042 | ||
|
|
8346b7b631 | ||
|
|
c441d7d3ce | ||
|
|
be8fcc98c5 | ||
|
|
658253a3fd | ||
|
|
0e96662a07 | ||
|
|
eb77c06571 | ||
|
|
a6cb70ed41 | ||
|
|
13596e8082 | ||
|
|
d9d56d77bc | ||
|
|
c886344e2f | ||
|
|
69cb049a39 | ||
|
|
38cdb4ddb1 | ||
|
|
b11a9e3ec8 | ||
|
|
268d23e9f6 | ||
|
|
f266577c75 |
@@ -51,8 +51,6 @@ fn workspace_root() -> Option<PathBuf> {
|
||||
const SESSION_COOKIE_NAME: &str = "codenomad_session";
|
||||
|
||||
const CLI_STOP_GRACE_SECS: u64 = 30;
|
||||
#[cfg(windows)]
|
||||
const CLI_WINDOWS_FORCE_GRACE_MS: u64 = 2_000;
|
||||
|
||||
#[cfg(unix)]
|
||||
fn configure_posix_process_group(command: &mut Command) {
|
||||
@@ -404,8 +402,6 @@ impl CliProcessManager {
|
||||
let mut child_opt = self.child.lock();
|
||||
if let Some(mut child) = child_opt.take() {
|
||||
log_line(&format!("stopping CLI pid={}", child.id()));
|
||||
#[cfg(windows)]
|
||||
let mut forced_tree_shutdown = false;
|
||||
#[cfg(unix)]
|
||||
unsafe {
|
||||
let pid = child.id() as i32;
|
||||
@@ -418,7 +414,9 @@ impl CliProcessManager {
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let _ = kill_process_tree_windows(child.id(), false);
|
||||
if !kill_process_tree_windows(child.id(), false) {
|
||||
let _ = child.kill();
|
||||
}
|
||||
}
|
||||
|
||||
let start = Instant::now();
|
||||
@@ -426,21 +424,6 @@ impl CliProcessManager {
|
||||
match child.try_wait() {
|
||||
Ok(Some(_)) => break,
|
||||
Ok(None) => {
|
||||
#[cfg(windows)]
|
||||
if !forced_tree_shutdown
|
||||
&& start.elapsed() > Duration::from_millis(CLI_WINDOWS_FORCE_GRACE_MS)
|
||||
{
|
||||
log_line(&format!(
|
||||
"regular Windows shutdown still running after {}ms; escalating pid={}",
|
||||
CLI_WINDOWS_FORCE_GRACE_MS,
|
||||
child.id()
|
||||
));
|
||||
forced_tree_shutdown = true;
|
||||
if !kill_process_tree_windows(child.id(), true) {
|
||||
let _ = child.kill();
|
||||
}
|
||||
}
|
||||
|
||||
if start.elapsed() > Duration::from_secs(CLI_STOP_GRACE_SECS) {
|
||||
log_line(&format!(
|
||||
"stop timed out after {}s; sending SIGKILL pid={}",
|
||||
@@ -457,11 +440,7 @@ impl CliProcessManager {
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
if !forced_tree_shutdown
|
||||
&& !kill_process_tree_windows(child.id(), true)
|
||||
{
|
||||
let _ = child.kill();
|
||||
} else if forced_tree_shutdown {
|
||||
if !kill_process_tree_windows(child.id(), true) {
|
||||
let _ = child.kill();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user