Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Cap ingress induction debit for cleanup callback #1777

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

dsarlis
Copy link
Member

@dsarlis dsarlis commented Oct 1, 2024

This fixes an edge case where in a cleanup callback that has produced some cycles balance change and when there's an accumulated ingress induction debit (due to ingress messages inducted while the cleanup callback was running DTS), the canister's balance might end up with an amount that wouldn't respect the canister's freezing threshold.

Typically, for other message executions, the DTS execution would fail if there were concurrent cycles changes that could not be applied. The cleanup callback is a bit different and failing it is not a good option; canisters depend on it running successfully to perform critical tasks (such as releasing locks or reverting state changes in case something goes wrong). Therefore, we should ensure that the cleanup callback can still complete successfully.

The solution (which the PR implements) is to cap the ingress induction debit by the amount removed from the cycles balance during execution. This way we can ensure completion of the cleanup callback at the expense of some cycles debit that is applied partially in some cases.

@dsarlis dsarlis requested review from a team as code owners October 1, 2024 13:06
@github-actions github-actions bot added the fix label Oct 1, 2024
@pakhomov-dfinity
Copy link
Contributor

Message Routing LGTM

@dsarlis dsarlis added this pull request to the merge queue Oct 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 2, 2024
@dsarlis dsarlis added this pull request to the merge queue Oct 2, 2024
Merged via the queue into master with commit 60f1d55 Oct 2, 2024
27 checks passed
@dsarlis dsarlis deleted the dimitris/fix-cleanup branch October 2, 2024 20:53
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.

4 participants