Skip to content

fix: [DSM-103] Reliably burn down idle canisters' positive AP#10255

Merged
alin-at-dfinity merged 1 commit into
masterfrom
alin/DSM-103-actually-burn-down-idle-canisters-AP
May 19, 2026
Merged

fix: [DSM-103] Reliably burn down idle canisters' positive AP#10255
alin-at-dfinity merged 1 commit into
masterfrom
alin/DSM-103-actually-burn-down-idle-canisters-AP

Conversation

@alin-at-dfinity
Copy link
Copy Markdown
Contributor

@alin-at-dfinity alin-at-dfinity commented May 19, 2026

The scheduler does not remove canisters from the schedule as soon as they become idle. Instead, in order to ensure that a canister with huge negative accumulated priority (AP) does not get scheduled with neutral priority (i.e. AP=0) a couple of rounds later by simply becoming idle for a round; and similarly, to preserve some AP for a couple of rounds for canisters that accumulated a lot of it before getting executed and becoming idle; we keep canisters in the schedule until their AP reaches zero, before dropping them. Canisters with negative AP simply accumulate it the same as active canisters; and positive AP canisters get charged every round as if they had a full execution round (which they would have, had they had any inputs).

The problem with the latter is that, on a mostly idle subnet, in the presence of a few canisters with heartbeats accumulating negative AP, an idle canister with positive AP cannot burn it down fast enough to compensate for the free priority that results from charging it and the heartbeat canisters.

The mitigation is to stop distributing free priority to idle canisters with positive AP, ensuring that they quickly reach AP=0.

The scheduler does not remove canisters from the schedule as soon as they become idle. Instead, in order to ensure that a canister with huge negative AP does not get scheduled with neutral priority (i.e. AP=0) a couple of rounds later simply by becoming idle for a round; and, similarly, to preserve some AP for canisters that accumulated a lot of it before getting executed and then became idle; we keep canisters in the schedule until their AP reaches zero before dropping them. Canisters with negative AP simply accumulate it same as active canisters; and positive AP canisters get charged every round as if they had a full execution (which they would have, had they had a small input).

The problem with the latter is that, on a mostly idle subnet, in the presence of a few canisters with heartbeats accumulating negative AP, an idle canister with positive AP cannot burn it down fast enough to compensate for the free priority resulting from charging the heartbeat canisters.

The mitigation is to stop distributing free priority to idle canisters with positive AP, ensuring that they soon reach zero AP.
@alin-at-dfinity alin-at-dfinity requested a review from a team as a code owner May 19, 2026 13:48
@github-actions github-actions Bot added the fix label May 19, 2026
@alin-at-dfinity alin-at-dfinity enabled auto-merge May 19, 2026 13:57
@alin-at-dfinity alin-at-dfinity added this pull request to the merge queue May 19, 2026
Merged via the queue into master with commit a0296de May 19, 2026
44 checks passed
@alin-at-dfinity alin-at-dfinity deleted the alin/DSM-103-actually-burn-down-idle-canisters-AP branch May 19, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants