Skip to content

Commit 89b602a

Browse files
committed
use file_id and row_id in logs
1 parent 13ff559 commit 89b602a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

compute/src/node/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ pub struct DriaComputeNode {
4848
task_request_batch_tx: Option<mpsc::Sender<TaskWorkerInput>>,
4949
/// Task worker transmitter to send single tasks.
5050
task_request_single_tx: Option<mpsc::Sender<TaskWorkerInput>>,
51-
// Single tasks, key is `row_id`
51+
/// Single tasks, key is `row_id`, which has negligible probability of collision.
5252
pub pending_tasks_single: HashMap<Uuid, TaskWorkerMetadata>,
53-
// Batchable tasks, key is `row_id`
53+
// Batchable tasks, key is `row_id`, which has negligible probability of collision.
5454
pub pending_tasks_batch: HashMap<Uuid, TaskWorkerMetadata>,
5555
/// Completed single tasks count
5656
completed_tasks_single: usize,

compute/src/reqres/task.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ impl TaskResponder {
3232
Err(err) => {
3333
let err_string = format!("{:#}", err);
3434
log::error!(
35-
"Task {} failed due to parsing error: {}",
35+
"Task {}/{} failed due to parsing error: {}",
36+
task.file_id,
3637
task.row_id,
3738
err_string
3839
);
@@ -102,8 +103,9 @@ impl TaskResponder {
102103
Ok(result) => {
103104
// prepare signed and encrypted payload
104105
log::info!(
105-
"Publishing {} result for {}",
106+
"Publishing {} result for {}/{}",
106107
"task".yellow(),
108+
task_metadata.file_id,
107109
task_output.row_id
108110
);
109111

@@ -129,7 +131,12 @@ impl TaskResponder {
129131
Err(err) => {
130132
// use pretty display string for error logging with causes
131133
let err_string = format!("{:#}", err);
132-
log::error!("Task {} failed: {}", task_output.row_id, err_string);
134+
log::error!(
135+
"Task {}/{} failed: {}",
136+
task_metadata.file_id,
137+
task_output.row_id,
138+
err_string
139+
);
133140

134141
// prepare error payload
135142
let error_payload = TaskResponsePayload {

0 commit comments

Comments
 (0)