Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Bosquet authored and Keksoj committed Sep 12, 2022
1 parent 6d293c5 commit b3c4f90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/src/command/orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ impl CommandServer {
&mut self,
request_identifier: RequestIdentifier,
) -> anyhow::Result<Option<Success>> {
info!("I tried so hard and got so far");
info!("Let's get the status of everyone.");

let (status_tx, mut status_rx) = futures::channel::mpsc::channel(self.workers.len() * 2);

Expand All @@ -894,6 +894,8 @@ impl CommandServer {

let mut count = 0usize;
for ref mut worker in self.workers.iter_mut() {
info!("Worker {} is {}", worker.id, worker.run_state);

// create request ids even if we don't send any request, as keys in the tree map
let worker_request_id = format!("{}{}", prefix, worker.id);
// send a status request to supposedly running workers to update the list afterwards
Expand All @@ -918,7 +920,10 @@ impl CommandServer {
let mut i = 0;

while let Some(proxy_response) = status_rx.next().await {
info!("received worker response: {:?}", proxy_response);
info!(
"received response with id {}: {:?}",
proxy_response.id, proxy_response
);
let new_run_state = match proxy_response.status {
ProxyResponseStatus::Ok => RunState::Running,
ProxyResponseStatus::Processing => continue,
Expand All @@ -933,7 +938,7 @@ impl CommandServer {
break;
}
}

let worker_info_vec: Vec<WorkerInfo> = worker_info_map
.iter()
.map(|(_, worker_info)| worker_info.to_owned())
Expand Down
1 change: 1 addition & 0 deletions bin/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ pub fn fork_main_into_worker(

serde_json::to_writer(&mut state_file, state)
.with_context(|| "could not write upgrade data to temporary file")?;

state_file
.seek(SeekFrom::Start(0))
.with_context(|| "could not seek to beginning of file")?;
Expand Down

0 comments on commit b3c4f90

Please sign in to comment.