Skip to content

Commit

Permalink
chore: EXC-1754: Apply priority credit at the end of the round (#2381)
Browse files Browse the repository at this point in the history
This change is functionally equivalent but necessary for the upcoming
priority-based eviction.
  • Loading branch information
berestovskyy authored Nov 6, 2024
1 parent 199229e commit 0a835cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rs/execution_environment/src/scheduler/round_schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,12 @@ impl RoundSchedule {
+ free_capacity_per_canister;
// Increase accumulated priority by de-facto compute allocation.
canister.scheduler_state.accumulated_priority += factual.into();

let has_aborted_or_paused_execution =
canister.has_aborted_execution() || canister.has_paused_execution();
if !has_aborted_or_paused_execution {
RoundSchedule::apply_priority_credit(canister);
}
}
}

Expand Down Expand Up @@ -417,9 +423,6 @@ impl RoundSchedule {

let has_aborted_or_paused_execution =
canister.has_aborted_execution() || canister.has_paused_execution();
if !has_aborted_or_paused_execution {
RoundSchedule::apply_priority_credit(canister);
}

let compute_allocation = canister.scheduler_state.compute_allocation;
let accumulated_priority = canister.scheduler_state.accumulated_priority;
Expand Down

0 comments on commit 0a835cc

Please sign in to comment.