Skip to content

docs(extras): correct MicroVM best practices - #826

Merged
ParidelPooya merged 5 commits into
mainfrom
docs/microvm-best-practices-followup
Oct 24, 2026
Merged

ParidelPooya merged 5 commits into
mainfrom
docs/microvm-best-practices-followup

Conversation

@ParidelPooya

@ParidelPooya ParidelPooya commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR addresses the review comments on #825. It changes only documentation and one docstring.

  • "Deploys and versions" rule 1 removed the scenario where the service returns the first attempt's MicroVM and the session records a mismatched resume mode. The repository has no recorded service result for it. The rule now states the outcome that the JS retry.ts states:

    • RunMicrovm rejects the reused client token with ValidationException.
    • default_microvm_retry_strategy does not retry it, so the launch fails with MicrovmLaunchError.
    • The operation runs no terminate step after a failed launch, so the first attempt's MicroVM runs until its maximum duration.
  • "Job inputs" rule 3 now lists the three ways a job goes over HTTP:

    • The run hook payload is over 4,096 code points.
    • The config sets request.path.
    • The job is a session job.

    It also names lambda:PassNetworkConnector on ALL_INGRESS. Without it, RunMicrovm fails with MicrovmLaunchError. The derived "about 3,600 code points" figure is removed.

  • "A job can run after MicrovmLaunchError" now holds only for run hook delivery. The change covers the best-practices rule, the Errors table, and the MicrovmLaunchError docstring. An HTTP launch request holds no job, and the request step starts only after a launch succeeds.

  • The "What it does" bullet on a MicroVM that the operation never learned now covers a retry that RunMicrovm rejects.

  • "Sessions" rule 2 states all three conditions for auto_suspend_idle_time: auto_suspend_on_idle=True, at least 10 seconds, and at most the session timeout. Each condition raises ValidationError when it is not met.

  • The worker README now says that a callback ID is forgotten after at least 1,000 other jobs end, not after more than 1,000.

Review fixes

  • Every place that selects the delivery now names all three HTTP cases: the README delivery list, the "Defaults and limits" connector bullet, and the ingress_network_connectors docstring. The "about 3,600 code points" figure is removed.
  • "Deploys and versions" rule 1 states the $LATEST consequence in two sentences, and names no error code.
  • The statement that no MicroVM runs the job after an HTTP launch fails now holds "when you invoke through a version or an alias".
  • The Errors table cell for MicrovmLaunchError is short. A list below the table explains the two deliveries.
  • The PassNetworkConnector example names a role that allows NO_INGRESS and INTERNET_EGRESS, but not ALL_INGRESS.

Testing

  • Each statement was checked against the code:
    • retry.py and retry_test.py.
    • launch(), run_job, and run_session, and the tests test_fails_with_the_launch_error_and_skips_terminate.
    • over_http, fits_run_hook, and _connector_arn in operation.py.
    • _validate_auto_suspend in session.py, and session_test.py.
    • MAX_FINISHED_JOBS and its eviction in worker.py.
  • hatch run dev-extras:cov passes 373 tests at 100 %. hatch fmt --check passes for the extras package. lintcommit.py passes. Every link and anchor resolves.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Address review comments on #825. A launch retry with changed settings
now fails with MicrovmLaunchError, as RunMicrovm rejects the reused
client token. The HTTP delivery, launch error, and idle time rules now
state their exact conditions.
The launch error docs now cover a retry that RunMicrovm rejects, and limit the repeated job to run hook delivery. The worker forgets a callback ID after at least 1,000 other jobs end, not more than 1,000. Addresses review comments on #825.
This addresses the review of #826. List every case that selects HTTP
delivery, and scope the HTTP launch guarantee to versions and aliases.
Cut the unverified reused-token detail from the launch error docs.
The default strategy does not retry ValidationException. The previous
commit removed it from the tier 2 list by mistake.
The ingress_network_connectors docstring stated twice that every
session job goes over HTTP. Addresses the second review of #826.
@ParidelPooya
ParidelPooya marked this pull request as ready for review October 24, 2026 02:22
@ParidelPooya
ParidelPooya deployed to ai-pr-review-runtime October 24, 2026 02:22 — with GitHub Actions Active
@ParidelPooya
ParidelPooya merged commit de59c85 into main Oct 24, 2026
24 checks passed
@ParidelPooya
ParidelPooya deleted the docs/microvm-best-practices-followup branch October 24, 2026 02:23

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — c8e20752 Deployed Oct 24, 2026 by ParidelPooya via notify / Generate notification summary #276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants