Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion aggregator/src/aggregator/aggregation_job_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,9 +1373,20 @@ where
}),
task_aggregation_counters.clone(),
);

// Determine the next Leader job state based on whether all reports are terminal.
let all_terminal = report_aggregations_to_write
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same observations as in #4323: if we're doing this here, we shouldn't do it again in the aggregation job writer. It seems like we consider it a safety net, but we should have enough confidence in our state transitions to avoid redundancy.

.iter()
.all(|ra| ra.is_terminal());
let new_state = if all_terminal {
AggregationJobState::Finished
} else {
AggregationJobState::Active
};

let new_step = aggregation_job.step().increment();
aggregation_job_writer.put(
aggregation_job.with_step(new_step),
aggregation_job.with_step(new_step).with_state(new_state),
report_aggregations_to_write,
)?;
let aggregation_job_writer = Arc::new(aggregation_job_writer);
Expand Down
Loading
Loading