Skip to content

MicroVM session: a launch retried across a deploy can record the wrong resume mode #815

Closed as not planned

Description

@ParidelPooya

Summary

A session launch step that is retried after a deploy can record a resume mode that does not match the MicroVM it launched.

Details

  1. The launch step computes the run hook payload and the resume mode from the current config.
  2. A failed first attempt, for example a throttled RunMicrovm, makes the step retry, possibly in a later invocation.
  3. A deploy between the attempts can change autoSuspendOnIdle or idlePolicy.
  4. Both attempts send the same client token. A review probe measured the payloads: the first attempt sent autoSuspendIdleSeconds: 60, the retry sent no idle time, and the step recorded "resumeBeforeDelivery": false.
  5. Suppose the first attempt created the MicroVM and only its response was lost. Then RunMicrovm either returns that MicroVM, whose worker suspends after 60 seconds, or rejects the changed parameters.
  6. In the first case, the session skips the state check for a MicroVM that suspends. The next job after a suspend then gets HTTP 502 from the suspended endpoint, and fails with MicrovmDeliveryError after both retry tiers.

Not verified: how RunMicrovm treats a reused client token with different parameters.

The code before the resumeBeforeDelivery field had the same gap. So this is not a regression.

Proposed fix

Decide the launch inputs once, before the first attempt. For example, a step before the launch step records the run hook payload, the idle policy, and the resume mode. The launch step and its retries then read them from that step's result, not from the current config. The JavaScript and Python SDKs share the launch checkpoint format, so both should make the same change.

Activity

  1. ParidelPooya commented on Oct 23, 2026

    @ParidelPooya
    ContributorAuthor

    JavaScript tracking issue: aws/aws-durable-execution-sdk-js#1066

  2. ParidelPooya commented on Oct 24, 2026

    @ParidelPooya
    ContributorAuthor

    Closing with a guideline instead of code. The MicroVM best-practices docs now cover this case (JS #1076/#1077, Python #825/#826).

    1. Lambda pins an execution that starts through a published version or an alias to that version. Every retry and replay then runs the same code and environment variables.
    2. So a launch retry can see different launch settings only under $LATEST, or when a setting is read outside a step from a source that can change.
    3. The docs say to invoke through a version or an alias, and to read such a setting inside a step. They also state the consequence under $LATEST: the launch can fail with MicrovmLaunchError, and a MicroVM from an earlier attempt can run until its maximum duration.

    Recording the launch inputs in a step would change the checkpoint format in every SDK. The guideline covers the same case without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions