Skip to content

Commit ef59572

Browse files
fix: [EXC-1836] Update hook status after update of canister settings (#3624)
The PR adds a check condition for the `low_wasm_memory` hook when canister settings are updated because changes of `wasm_memory_threshold` or `wasm_memory_limit` or `memory_allocation` can trigger or un-trigger hook condition. --------- Co-authored-by: Adam Bratschi-Kaye <adam.bratschikaye@dfinity.org>
1 parent bf5d853 commit ef59572

File tree

2 files changed

+442
-6
lines changed

2 files changed

+442
-6
lines changed

rs/execution_environment/src/canister_manager.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ impl CanisterManager {
643643
if let Some(wasm_memory_limit) = settings.wasm_memory_limit() {
644644
canister.system_state.wasm_memory_limit = Some(wasm_memory_limit);
645645
}
646+
// Change of `wasm_memory_limit` or `new_wasm_memory_threshold` or `memory_allocation`,
647+
// can influence the satisfaction of the condition for `low_wasm_memory` hook.
648+
canister.update_on_low_wasm_memory_hook_condition();
646649
}
647650

648651
/// Tries to apply the requested settings on the canister identified by
@@ -867,12 +870,15 @@ impl CanisterManager {
867870
);
868871
match dts_result {
869872
DtsInstallCodeResult::Finished {
870-
canister,
873+
mut canister,
871874
call_id: _,
872875
message: _,
873876
instructions_used,
874877
result,
875-
} => (result, instructions_used, Some(canister)),
878+
} => {
879+
canister.update_on_low_wasm_memory_hook_condition();
880+
(result, instructions_used, Some(canister))
881+
}
876882
DtsInstallCodeResult::Paused {
877883
canister: _,
878884
paused_execution,

0 commit comments

Comments
 (0)