Skip to content

Commit

Permalink
Make logs not fail in the daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
haixuanTao committed May 2, 2023
1 parent 0854f91 commit 7f82f32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions binaries/coordinator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,12 @@ async fn retrieve_logs(
let reply_logs = match serde_json::from_slice(&reply_raw)
.wrap_err("failed to deserialize logs reply from daemon")?
{
DaemonCoordinatorReply::Logs { logs } => logs,
DaemonCoordinatorReply::Logs(logs) => logs,
other => bail!("unexpected reply after sending reload: {other:?}"),
};
tracing::info!("successfully retrieved logs for `{dataflow_id}/{node_id}`");

Ok(reply_logs)
reply_logs.map_err(|err| eyre!(err))
}

async fn start_dataflow(
Expand Down
4 changes: 2 additions & 2 deletions binaries/daemon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ impl Daemon {
Result::<Vec<u8>, eyre::Report>::Ok(contents)
}
.await
.expect("Could not retrieve logs");
.map_err(|err| format!("{err:?}"));
(
Some(DaemonCoordinatorReply::Logs { logs }),
Some(DaemonCoordinatorReply::Logs(logs)),
RunStatus::Continue,
)
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/core/src/daemon_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub enum DaemonCoordinatorReply {
StopResult(Result<(), String>),
DestroyResult(Result<(), String>),
WatchdogAck,
Logs { logs: Vec<u8> },
Logs(Result<Vec<u8>, String>),
}

pub type DataflowId = Uuid;
Expand Down

0 comments on commit 7f82f32

Please sign in to comment.