Skip to content

Commit

Permalink
chore: Fail if we cannot decrement subnet available memory after vali…
Browse files Browse the repository at this point in the history
…dating canister's settings (#4014)
  • Loading branch information
dsarlis authored Feb 21, 2025
1 parent 6aefd29 commit 2f17dd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rs/execution_environment/src/canister_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ impl CanisterManager {
round_limits
.subnet_available_memory
.try_decrement(new_mem - old_mem, NumBytes::from(0), NumBytes::from(0))
.ok();
.expect("Error: Cannot fail to decrement SubnetAvailableMemory after validating the canister's settings");
} else {
round_limits.subnet_available_memory.increment(
old_mem - new_mem,
Expand Down Expand Up @@ -1379,7 +1379,7 @@ impl CanisterManager {
round_limits
.subnet_available_memory
.try_decrement(new_mem, NumBytes::from(0), NumBytes::from(0))
.ok();
.expect("Error: Cannot fail to decrement SubnetAvailableMemory after validating canister's settings");

round_limits.compute_allocation_used = round_limits
.compute_allocation_used
Expand Down

0 comments on commit 2f17dd8

Please sign in to comment.