Skip to content

Commit

Permalink
Use more tracing fields instead of string interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Nov 23, 2024
1 parent a73d186 commit 97ed594
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions compiler/base/orchestrator/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ impl Container {
already_cancelled = true;

let msg = CoordinatorMessage::Kill;
trace!("processing {msg:?}");
trace!(msg_name = msg.as_ref(), "processing");
to_worker_tx.send(msg).await.context(KillSnafu)?;
},

Expand All @@ -1847,12 +1847,12 @@ impl Container {
}
};

trace!("processing {msg:?}");
trace!(msg_name = msg.as_ref(), "processing");
to_worker_tx.send(msg).await.context(StdinSnafu)?;
},

Some(container_msg) = from_worker_rx.recv() => {
trace!("processing {container_msg:?}");
trace!(msg_name = container_msg.as_ref(), "processing");

match container_msg {
WorkerMessage::ExecuteCommand(resp) => {
Expand Down Expand Up @@ -2382,13 +2382,13 @@ impl Commander {
Command(Some((ack_tx, command))) => {
match command {
DemultiplexCommand::Listen(job_id, waiter) => {
trace!("adding listener for {job_id:?}");
trace!(job_id, "adding listener (many)");
let old = waiting.insert(job_id, waiter);
ensure!(old.is_none(), DuplicateDemultiplexerClientSnafu { job_id });
}

DemultiplexCommand::ListenOnce(job_id, waiter) => {
trace!("adding listener for {job_id:?}");
trace!(job_id, "adding listener (once)");
let old = waiting_once.insert(job_id, waiter);
ensure!(old.is_none(), DuplicateDemultiplexerClientSnafu { job_id });
}
Expand All @@ -2400,18 +2400,18 @@ impl Commander {
FromWorker(None) => break,
FromWorker(Some(Multiplexed(job_id, msg))) => {
if let Some(waiter) = waiting_once.remove(&job_id) {
trace!("notifying listener for {job_id:?}");
trace!(job_id, "notifying listener (once)");
waiter.send(msg).ok(/* Don't care about it */);
continue;
}

if let Some(waiter) = waiting.get(&job_id) {
trace!("notifying listener for {job_id:?}");
trace!(job_id, "notifying listener (many)");
waiter.send(msg).await.ok(/* Don't care about it */);
continue;
}

warn!("no listener for {job_id:?}");
warn!(job_id, "no listener to notify");
}

Gc => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/base/orchestrator/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ macro_rules! impl_narrow_to_broad {
#[derive(Debug, Serialize, Deserialize)]
pub struct Multiplexed<T>(pub JobId, pub T);

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, strum_macros::AsRefStr)]
pub enum CoordinatorMessage {
WriteFile(WriteFileRequest),
DeleteFile(DeleteFileRequest),
Expand Down

0 comments on commit 97ed594

Please sign in to comment.