Repository navigation
fix: mend nine bugs in sessions on AWS Lambda microVMs - #670
Merged
Merged
Conversation
Nine bugs came in with #665's AWS Lambda microVM support: - A microVM that was starting or resuming as its session's run ended, or whose suspend failed, ran until Lambda's 8-hour end. The upkeep now suspends one that has gone a minute so, or lets it go if it can't. - A warm microVM that failed to start for a reason the pool doesn't pause for was replaced at once, without end. The pool waits a minute after a failed start. - A failed upload of the image's archive was retried every 5 seconds and shown nowhere. It is now the runner's problem and the image's error, and waits 30 minutes as a failed build does, still saying why. - After the image changed, the host forgot the microVMs a list of the new image lacked, sessions' included, without terminating them. It now asks Lambda about each and forgets only those Lambda says are gone, and only if a session's next run hasn't replaced it meanwhile. - Workspace admins couldn't take a microVM runner out, or remove a member's that enrolled here: the cards now offer Take out and Remove as runner rows do. - An image version the server refused showed no error: it shows under Version, and the web app checks it before saving. - A checkpoint that timed out stopped a session from suspending again: a finished upload no longer holds the next one off. - fctl-agent downloads for two architectures shared one temp file. - In microvm-serve, a chunk size near usize::MAX overflowed the body's length check and panicked the connection's task. Tested with new tests in the host's driver, fctl-agent's HTTP reader and the web app, which fail without the fixes. fctl session: https://app.fctl.sh/s/ses_01M8VDPX5PJ1316JEN10GTNFRK
This comment has been minimized.
This comment has been minimized.
The upkeep checked a microVM's session had ended once, then awaited a suspend of up to a minute, or other microVMs' terminates, before letting it go by its name: a session's next run that took it back meanwhile, or ran a new one by that name, lost its microVM. It checks again after each await that the microVM is the same one, its run still ended and no session's host works on it. A download of fctl-agent that failed to write or rename its temporary file, which is named for that download alone, now removes it.
Contributor
Author
|
On the review's second finding, that failed downloads left their temporary files behind: fixed in 43a5520. When writing, setting permissions on or renaming the temporary file fails, the download now removes the file, so each failed try no longer leaves a binary-sized file in the bin directory. |
kalaspuff
approved these changes
Dec 2, 2026
Contributor
Author
|
The failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes nine bugs that came in with #665's AWS Lambda microVM support. Some left microVMs running, and billing, for hours, some made the host retry at once without end, and some hid errors from people:
with_extensioncut the name at the version's last dot. Each download now has a temp file of its own, which it removes if it fails.microvm-serve, a chunk size nearusize::MAXoverflowed the body-length check and panicked the connection's task. It is now refused.New tests cover the first four bugs, Take out and Remove, the version error and the chunk size. I checked that the tests for the first two, the forgotten microVMs, the cards and the version error fail without their fixes, as does the test where a session takes its microVM back while the upkeep suspends it. fctl-host's 334 tests, fctl-agent's microVM tests, the web app's tests,
npm run checkandcargo xtask check lintpass. docs/architecture.md describes the new behavior.Screenshots
Before: a microVM runner added from elsewhere, and a member's that enrolled here, offered admins only Open (dark theme).
After: Take out and Remove, as runner rows offer them, in the dark and light themes and at phone width.
An image version with a space in it, after Save: before, nothing said what was wrong; after, the error shows under Version.
Worth confirming
fctl session
Note
Medium risk. It changes how the host upkeep suspends, terminates and forgets AWS Lambda microVMs, which can destroy a session's suspended disk if a case is wrong, and it changes the checkpoint loop every session runs.
What it does. Fixes nine bugs in the AWS Lambda microVM support: the upkeep now suspends or lets go of microVMs whose run ended unsuspended, the warm pool waits a minute after a failed start, and a failed image archive upload is shown and retried after 30 minutes. It also asks Lambda before forgetting a microVM missing from a list, adds Take out and Remove to the microVM cards, shows image version errors, lets a finished upload stop holding off the next checkpoint, gives each agent download its own temp file, and refuses an oversized chunk in
microvm-serve. Before the upkeep lets a microVM go, it now checks again that a session hasn't taken it back meanwhile.Lost disk on failed suspend. A microVM that ended unsuspended and then fails to suspend is let go of at once instead of retried, so the session's next run starts in a new microVM without the suspended one's disk.
fctl review's first look at
cc1156a· 10 files, +531 −55 · Review agent settings