Skip to content

Commit

Permalink
kernel: fix: use mutated process metadata on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-frmr committed Mar 15, 2024
1 parent 6082ee6 commit fac2073
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kinode/src/kernel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,6 @@ async fn handle_kernel_request(
return;
}
};
let _ = send_to_terminal
.send(t::Printout {
verbosity: 2,
content: format!("killing process {process_id}"),
})
.await;
process_handle.abort();
process_map.remove(&process_id);
caps_oracle
Expand All @@ -484,6 +478,12 @@ async fn handle_kernel_request(
.await
.expect("event loop: fatal: sender died");
if request.expects_response.is_none() {
let _ = send_to_terminal
.send(t::Printout {
verbosity: 2,
content: format!("killing process {process_id}"),
})
.await;
return;
}
let _ = send_to_terminal
Expand Down
3 changes: 3 additions & 0 deletions kinode/src/kernel/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,9 @@ pub async fn make_process_loop(
// the process has completed, time to perform cleanup
//

// update metadata to what was mutated by process in store
let metadata = store.data().process.metadata.to_owned();

let our_kernel = t::Address {
node: metadata.our.node.clone(),
process: KERNEL_PROCESS_ID.clone(),
Expand Down

0 comments on commit fac2073

Please sign in to comment.