How does a timer task that is already running behave if the number of cycles required by the value of the 'freezing threshold' falls below the remaining amount?

There are two cases:

  1. The canister balance is below the freezing threshold. In this case, the CDK code will be called only when the canister balance is above the freezing threshold as described above.

  2. The canister balance is very close to the freezing threshold. In this case the Rust CDK code might be executed, but there might be not enough cycles to execute the user code. This was fixed recently, so the Rust CDK library should now retry user code execution once there are enough cycles.

So, to best of our knowledge, the periodic execution should gracefully handle low cycles balances in Rust CDK.

Note, there are likely still some corner cases, such as when the canister runs out of memory. In this case the Rust CDK code will panic, and the error message should be available in the canister log.

For completeness, all the timers are deactivated after a canister upgrade.

1 Like