Skip to content

Commit

Permalink
Use u32 instead of usize for PID
Browse files Browse the repository at this point in the history
  • Loading branch information
haixuanTao committed Apr 29, 2024
1 parent dc11e8e commit 3d516e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions binaries/daemon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ fn close_input(

#[derive(Debug, Clone)]
struct RunningNode {
pid: usize,
pid: u32,
}

pub struct RunningDataflow {
Expand Down Expand Up @@ -1444,7 +1444,7 @@ impl RunningDataflow {
system.refresh_processes();

for (node, node_details) in running_nodes.iter() {
if let Some(process) = system.process(Pid::from(node_details.pid.clone())) {
if let Some(process) = system.process(Pid::from(node_details.pid as usize)) {
process.kill();
warn!(
"{node} was killed due to not stopping within the {:#?} grace period",
Expand Down
4 changes: 2 additions & 2 deletions binaries/daemon/src/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub async fn spawn_node(
daemon_tx: mpsc::Sender<Timestamped<Event>>,
dataflow_descriptor: Descriptor,
clock: Arc<HLC>,
) -> eyre::Result<usize> {
) -> eyre::Result<u32> {
let node_id = node.id.clone();
tracing::debug!("Spawning node `{dataflow_id}/{node_id}`");

Expand Down Expand Up @@ -264,7 +264,7 @@ pub async fn spawn_node(
.expect("Failed to create log file");
let mut child_stdout =
tokio::io::BufReader::new(child.stdout.take().expect("failed to take stdout"));
let pid = child.id().unwrap() as usize; // Todo: Manage failure
let pid = child.id().unwrap();
let stdout_tx = tx.clone();

// Stdout listener stream
Expand Down

0 comments on commit 3d516e3

Please sign in to comment.