Browse Source

Use u32 instead of usize for PID

tags/v0.3.4-rc1
haixuanTao 1 year ago
parent
commit
9f8bb2c0a5
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      binaries/daemon/src/lib.rs
  2. +2
    -2
      binaries/daemon/src/spawn.rs

+ 2
- 2
binaries/daemon/src/lib.rs View File

@@ -1330,7 +1330,7 @@ fn close_input(

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

pub struct RunningDataflow {
@@ -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",


+ 2
- 2
binaries/daemon/src/spawn.rs View File

@@ -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}`");

@@ -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


Loading…
Cancel
Save