You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MicroVM session: read the resume mode from the launch checkpoint (resumeBeforeDelivery) #798
microvm_session computes its resume mode from the current config on every replay. It should read the mode from the launch checkpoint, as the JavaScript SDK now does.
Details
The resume mode says whether each session job checks the MicroVM state, and resumes a suspended MicroVM, before delivery. _SessionScope.resume_before_delivery in microvm/session.py computes it from auto_suspend_idle_seconds and idle_policy.
The worker reads its idle time once, from the run hook payload of the launch. RunMicrovm sets the idle policy once, at the launch.
So a deploy that turns auto_suspend_on_idle off, or removes idle_policy, does not stop a running MicroVM from suspending.
The next job then skips the state check, and the suspended endpoint answers 502.
The request step retries a 502 as a MicroVM that is still starting. So the job fails with MicrovmDeliveryError only after both retry tiers.
Proposed fix
aws/aws-durable-execution-sdk-js#1042 adds a field to the session's launch checkpoint. The checkpoint format is shared, so Python must use the same field.
A session launch writes "resumeBeforeDelivery": true or "resumeBeforeDelivery": false in the launch step result, next to microvmId, endpoint and delivery.
On replay, the session reads the field instead of the current config.
Read the field with isinstance(value, bool). In Python True == 1, so a looser check would accept 1. A checkpoint without the field, or with a value that is not a bool, falls back to the current config.
microvm() single jobs write no such key. So LaunchResult.to_dict must omit it when the value is None.
Activity
fix(extras): record the session resume mode (#811)