Skip to content

Commit

Permalink
refactor: [EXC-1724] Refactor task_queue (#1490)
Browse files Browse the repository at this point in the history
Refactor SystemState::task_queue to be a new struct with an additional
field on_low_wasm_memory_hook_status, to ensure that whenever available
first task that will be poped from the task queue is OnLowWasmMemoryHook
(excluding paused executions).

In the [follow-up](https://dfinity.atlassian.net/browse/EXC-1725) we
will add logic in which when doing operations on task queue, in the case
there are no paused executions in the queue, it is checked if
`on_low_wasm_memory_hook_status` is `Ready`, and if so it will be
returned as it is on the front of the queue. That will ensure that the
hook is executed right after the execution of the message/task that
triggered the hook condition.

---------

Co-authored-by: Alin Sinpalean <[email protected]>
Co-authored-by: Dimitris Sarlis <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2024
1 parent fcad095 commit 5127f04
Show file tree
Hide file tree
Showing 15 changed files with 461 additions and 256 deletions.
60 changes: 30 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions rs/canister_sandbox/src/sandbox_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ mod tests {
use ic_limits::SMALL_APP_SUBNET_MAX_SIZE;
use ic_logger::replica_logger::no_op_logger;
use ic_registry_subnet_type::SubnetType;
use ic_replicated_state::{
canister_state::system_state::OnLowWasmMemoryHookStatus, Global, NumWasmPages, PageIndex,
PageMap,
};
use ic_replicated_state::{Global, NumWasmPages, PageIndex, PageMap};
use ic_system_api::{
sandbox_safe_system_state::{CanisterStatusView, SandboxSafeSystemState},
ApiType, ExecutionParameters, InstructionLimits,
Expand Down Expand Up @@ -231,7 +228,6 @@ mod tests {
RequestMetadata::new(0, Time::from_nanos_since_unix_epoch(0)),
caller,
0,
OnLowWasmMemoryHookStatus::ConditionNotSatisfied,
)
}

Expand Down
Loading

0 comments on commit 5127f04

Please sign in to comment.