Skip to content

Commit

Permalink
start replica and pocketic in their own process groups
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Jan 13, 2025
1 parent c2a8857 commit 2f826a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/dfx/src/actors/pocketic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ fn pocketic_start_thread(
}
cmd.stdout(std::process::Stdio::inherit());
cmd.stderr(std::process::Stdio::inherit());
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;
cmd.process_group(0);
}
let _ = std::fs::remove_file(&config.port_file);
let last_start = std::time::Instant::now();
debug!(logger, "Starting PocketIC...");
Expand Down
5 changes: 5 additions & 0 deletions src/dfx/src/actors/pocketic_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ fn pocketic_proxy_start_thread(
cmd.args(["--port-file".as_ref(), pocketic_proxy_port_path.as_os_str()]);
cmd.stdout(std::process::Stdio::inherit());
cmd.stderr(std::process::Stdio::inherit());
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;
cmd.process_group(0);
}
let _ = std::fs::remove_file(&pocketic_proxy_port_path);
let last_start = std::time::Instant::now();
debug!(logger, "Starting pocket-ic gateway...");
Expand Down
6 changes: 5 additions & 1 deletion src/dfx/src/actors/replica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ fn replica_start_thread(

cmd.stdout(std::process::Stdio::inherit());
cmd.stderr(std::process::Stdio::inherit());

#[cfg(unix)]
{
use std::os::unix::process::CommandExt;
cmd.process_group(0);
}
loop {
if let Some(port_path) = write_port_to.as_ref() {
let _ = std::fs::remove_file(port_path);
Expand Down

0 comments on commit 2f826a5

Please sign in to comment.