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
Roll: nothing in silkd, the guest images or the boot files changed since v0.1.39. Every behaviour change in this release is in sandboxd. No new guest image is needed. The version bump moves silkd's crate version to 0.1.40, so a guest image built from this tag reports silkd 0.1.40 with the code of 0.1.39 (and 0.1.38); images built from earlier tags need not be rebuilt. Roll sandboxd node by node, and roll every node before a control plane relies on the minted token (note 4).
Config: no key is added, renamed or removed.
State: no persisted shape changed. The range touches no type sandboxd writes to claims.json, pools.json, the archive registry, the move commits or the usage journal, and no json tag. The archive mark (note 6) is an in-memory map.
Root-adopted claims serve a token (#682). A claim the root adopted from the archive comes without its own token (the registry row keeps only its hash), so the node mints one. v0.1.39 held that token back, and root's GET /v1/sandboxes/{id} returned no token for such a claim until a call presented the claim's own token; a control plane that keeps no copy had nothing that worked once the claim moved on through a root adoption, and the agent and port relays refused every call until the claim was released. Now:
root's and the operator's GET /v1/sandboxes/{id} return the minted token, and the claim answers it like its own token. The claim's own token still works and, when a call presents it, replaces the minted one. A tenant token still gets 403 on that read. The operator's read of such a claim is now audited as a token read, as for every other claim with a token.
The minted token stays with the claim through a live move and a resize. It does not adopt the claim on another node (the registry row carries only the hash of the own token).
It ends when the own token replaces it, or when the root adopts the claim again, which every hand-off of such a claim is (an evacuation, and a wake handed to a peer because the node is full); each root adoption mints a new one. A call with an ended minted token answers 404, as for a released claim: read root's GET /v1/sandboxes/{id} again for the token that works.
The replacement by the own token is saved at the claim's next record write or at a clean shutdown; a node that crashes before that serves and accepts the minted token again until the own token returns.
A claim adopted before the upgrade already holds its minted token in claims.json and serves it after the upgrade, with no migration.
Mixed versions and rollback: a live move of such a claim to a v0.1.26 to v0.1.39 node, or a rollback onto one, hides the minted token and refuses it there; the claim's own token still works. Roll every node before a control plane relies on it.
Preview (#691, fixes #683 and #690, known limits of v0.1.39): a preview reply the guest app sends before the browser has sent the whole request body is relayed whole, and it carries Connection: close, so that connection is not reused. A client that sends an upload and reads while it sends, or one that stops sending when it sees the status, gets the whole reply in the cells measured; see Changes for what remains and what it costs. Connection: close is set on a reply relayed from the guest app (or from the owner node on a forward hop) and on the owner-side proxy's own error reply, while the upload has not ended. A request with no body, or whose body was read to its end, gets no header and keeps its connection. The 403 for an invalid or expired preview token and the forward hop's own 502 are unchanged.
Archive mark (#696, #703, bugs in v0.1.39; see Changes): a renew of a claim that a wake or a resize took from a running archive job now succeeds while its VM is up, where v0.1.39 answered 409 sandbox is archived; a wake or an exec wakes it first. An archive job that finds a claim a wake took since it was marked now gives it up instead of archiving it, so the claim keeps the wake's lease; no log line is written for that.
SDKs: Go SDK v0.1.40 changes no client behaviour. #694 reshaped 13 production files under sdk/go (each request is encoded in one place, Exec and the stream openers share a helper, comments removed); the requests sent, the errors returned and their texts are the same, and mcp and protocol/wire have no change in the range. cocoonstack-sandbox 0.1.40 for Python carries no change beyond its version (nothing under sdk/python changed). The OpenAI and LangChain adapters are not republished. Go 1.27.4 and Python 3.12 stay the floors.
Rollback to v0.1.39: nothing to remove or convert; config, journals and registry rows keep the v0.1.39 shapes. A rollback brings back the v0.1.39 behaviour of notes 4 to 6: root-adopted claims hide and refuse the minted token again (the own token still works), a preview reply can be cut or can stall as described in Changes, and the archive-mark bugs return.
Mixed v0.1.39 and v0.1.40 nodes: no node-to-node call changed. The new answers of notes 4 and 6 come from the node that owns the claim. Two cases cross nodes. The minted token (note 4) is served and accepted only on a v0.1.40 node. A preview request that enters on another node gets the behaviour of note 5 only when that entry node runs v0.1.40 too: each node relays its own leg, and the owner's Connection: close does not pass through an older entry node.
Changes
Root-adopted claims serve their token (#682). See upgrade note 4. The by-id read keeps the minted token instead of blanking it, and the token check tries the claim's current token first (the minted one included) and then the hash of the own token. The docs state what the minted token is good for, how long it lasts, the 404 and the re-read (API page, by-id read, evacuation paragraph, /owner), and that a wake hand-off and an evacuation of such a claim mint a new token and that root's GET /owner adopts a released row no node lists, so a holder that reads the token back no longer loses the claim (cluster page).
A preview reply is relayed whole when the guest answers before the upload ends (#691, fixes #683 and #690).
What a user saw in v0.1.39: the guest app answered before the browser had sent the whole request body (a 4xx to an upload, or an answer streamed while it reads), and the browser got a body shorter than its Content-Length or a chunked body that ended in unexpected EOF. A client that stopped sending when it saw no reply got none at all, because the node read up to 256 KiB of the upload before it wrote the reply header. An Expect: 100-continue upload that the guest refused before the node asked for the body left the node waiting for a body the client never sends; through a forward hop the two nodes waited on each other for good (#690; one run in 120 on macOS).
Fix: both preview proxies (the owner node and a forward entry node) wrap the request body. A reply that arrives while the upload has not ended carries Connection: close, and the node writes it at once. When the reply ends, the node stops relaying the upload and ends a read of it still in flight with a read deadline, so the handler never waits for the client. The node then reads at most one more 256 KiB window of the upload (none when more than 256 KiB of a declared length is unread) and closes the connection. A body the client was never asked for (Expect, no read happened) is not read.
What changes for a client: the reply is whole and arrives at once, the connection ends after an early reply, and a refused Expect upload closes instead of stalling, and a refusal of a few KiB arrives whole. An upgrade (WebSocket) is untouched: a 101 reply carries no header.
Accepted cost, measured on a Linux container (go1.27.4, real TCP on loopback, arms alternated):
An early reply ends the connection: where the guest answers an Expect upload at once, 57 of 80 replies on the owner now carry Connection: close (v0.1.39: 6 of 80).
A client that stops sending and closes its side is released about 507 ms after that close in the cases where the node reads nothing more (v0.1.39 released a declared-length upload after 11 ms, with no reply). A client that stops sending inside the 256 KiB window and keeps its socket open holds the connection until it closes it; v0.1.39 held the same client, before any reply.
A client that reads nothing until its whole upload is written depends on how much of the upload the node takes off the socket. With a 256 KiB reply and a chunked upload, 512 KiB and 768 KiB uploads are cut less often than in v0.1.39; about 1 MiB is cut more often (17 to 20 of 20 runs in the four cells, against 10 to 17 of 20); 2 MiB is cut in 20 of 20 on both. With a declared length the 1 MiB cell is 20 of 20 on both. Replies of 16 KiB and 64 KiB are whole in every run of the sweep, apart from one 502 of 20 in two cells that v0.1.39 has too.
One matrix cell is worse with no mechanism that separates the arms: a guest that closes, a 64 KiB reply, the client waits, through the forward hop: 8 cut of 80 against 3 of 80 (3 against 3 in the round before). All of them are the guest-closed cut of #689.
Over the last round of 206 cells, the change had fewer bad outcomes than v0.1.39 in 119 cells, as many in 78 and more in 9; runs that hung until the probe's timeout: 8 on v0.1.39, none with the change.
Docs: the deploy page's "Early replies" paragraph states what is relayed whole now, the Expect upload that pauses after its 100 Continue (#692, docs by #693), the 256 KiB read and the close, and the two cases that can still truncate a reply (see Known limits).
A claim a wake or a resize took from an archive job no longer counts as archiving (#696, a bug in v0.1.39). An archive job (the idle sweep, the reap, an evacuation's pause) marks a claim from its pick until it returns, and its export holds no lock on the claim, so a wake or a resize can take the claim back meanwhile. A wake can also take it in the job's tail: after the archive committed, while the job destroys the old VM and snapshot. v0.1.39 went on treating such a claim as archiving until the job returned: POST /renew answered 409 sandbox is archived; a wake or an exec wakes it first, liveness recovery and replication skipped it, and a live move refused it; a claim that could not renew could reach its lease end and be reaped while the export was still running. Now a claim a wake (a cold-boot wake included), a resize or the wake of an archived claim took is not archiving while its VM should be up. The export still gives the claim up on its own. A claim that is hibernated again while the same job is in flight (a resize undone by a failed journal write, an evacuation's pause, a second hibernate before the job looks at it) counts as archiving again, and renew answers 409 as before.
An archive job gives up a claim a wake took since it was marked (#703, fixes #698, a bug in v0.1.39). A reap or sweep job marks a claim and archives it later, and between the two it checked only the claim's shape. A wake in between gives a lapsed claim a fresh lease. If the claim was hibernated again before the job looked at it, or was running again under the reaper's pause, the job archived it anyway (the pause hibernating it first) and overwrote the wake's lease with the retention deadline; after #696 a renew of the woken claim could also be granted and then overridden. The doors were the reaper's pause-then-archive of a running claim, the reaper's archive of a hibernated one, and the idle archive sweep. Now the job leaves the claim as the wake left it, with the wake's lease, and the next sweep or reap decides again. A claim the node is evacuating is archived whatever its mark.
Dependency round (8716079).aws-sdk-go-v2 1.48.2, config 1.33.23, service/s3 1.117.0, smithy-go 1.28.11 and their 14 indirect siblings (sandboxd's go.mod and go.sum only). The changelogs of all 18 modules between the old and the new versions were read: the indirect ones list only the smithy-go bump, with two bug fixes in eventstream (event-stream message lengths); service/s3 1.117.0 adds the GetPart operation; smithy-go 1.28.10 and 1.28.11 fix event-stream encoding and decoding, JSON blob decoding (CPU and allocations) and a test. In the root aws-sdk-go-v2 1.48.0 to 1.48.2 the only Go source file that differs is the version constant. sandboxd calls only GetObject, PutObject, ListObjectsV2 and DeleteObjects, and uses no event-stream operation. No change to retry, checksum, connection, presign or multipart defaults appears in what was read.
Docs. Besides the paragraphs named above, the API page's evacuation paragraph says root's by-id read on the peer returns a token for the claim, and the /owner section says that read returns the minted token until the claim's own token arrives.
Internal.#694 is a behaviour-preserving cleanup of production code, +135 −302 lines in 48 files and no test file: shared helpers for repeated blocks (the e2e commands' exit, engine JSON decoding, the Go SDK's request encoding and stream opening), stdlib forms (cmp.Or, slices.ContainsFunc, bufio.Reader.WriteTo, AppendUint64) and 15 comments that restated the code. No log line, error text or status a user can see changed. #695 and #697 are test cleanups (shared setup helpers; +558 −929 lines in 35 files outside sandboxd/pool, +1201 −2501 in 59 files in it; three table folds in #695, no test removed). #686 cuts three comparisons that could not fire (+25 −34 lines in the volume run and the reboot settle). #704 makes a test helper read the whole goroutine dump (+4 lines).
Hardware
#691 on a testbed host (cocoon v0.8.1, a Cloud Hypervisor dev build): a private sandboxd per block, one claimed sandbox with a raw-TCP test server in it, requests through a minted preview URL on the owner path (the guest connection is the relayed stream, not loopback TCP). Four blocks, previous main (which already holds #682 and #686), the change, the change, previous main; 25 connections per cell per block, and the two blocks of each arm gave the same counts. The change's build is the PR's final head; its preview.go equals this release's except for the spelling of one expression.
The guest answers 64 KiB at once and keeps reading, with a declared 1 MiB upload and then a chunked one, the client reading while it sends: whole 50 of 50 on both, and Connection: close on every change reply.
The guest answers 64 KiB and closes, declared 256 KiB upload: previous main cut 4 of 50 and held the connection open after 3 s in 46; the change was whole 50 of 50 and held none.
The guest answers a short chunked reply and closes after 1 KiB of a declared 16 KiB, then the client goes silent with its socket open: previous main gave no reply in 50 of 50, the change was whole 50 of 50 (and the silent client then holds the connection, the cost above).
An Expect upload read whole, then a GET on the same connection: 200, 200 on both. Four uploads and four GETs per connection: 200 in 400 of 400 on both. A declared 256 KiB upload written whole before the first read, 64 KiB reply: whole 50 of 50 on both.
After each block: no panic and no http: superfluous line in the log, a goroutine dump with no goroutine in the upload wrapper or in the body close, and the claim released (204, then 404). Claim latency 0.85 to 1.1 ms in all four blocks.
Limits of the round: previous main did not cut the first two cells on this hardware as it does on loopback, so the arms differ in the third and fourth cells only. A refused Expect upload always got its 100 Continue first on the relayed stream (100 of 100 on both arms), so the path of #690 is covered by the container runs and the tests, not by hardware. The forward hop was not in the round.
Not run on hardware:
#682 (the change is the in-memory token check and one HTTP read; the hardware round above contained it in both arms but did not exercise it).
#696 and #703 (the window needs an export held open while a wake commits, or a wake and a hibernate between a mark and its job; on a real host that is a race with no lever, so both rest on unit tests and mutation checks).
#686 (nothing reachable changes), #694, #695, #697, #704 and the dependency round (build, lint and test gates, and CI only).
Hot path and cost
Claim path: nothing in this range touches it. No change to ClaimWarm, ClaimProvision, finalize, the port dials or the wake of a running claim.
Minted token (#682): authed costs one constant-time compare for an ordinary claim and for a minted-token caller, as before; a claim's own token on a root-adopted claim costs one compare and one SHA-256 once, then it is an ordinary claim. Manager.Sandbox lost a branch.
Preview (#691): per preview request, two allocations without a body and three with one, and one uncontended mutex lock per body read; a request with no body stores one flag. The preview proxy is not on the claim or the agent path.
Archive mark (#696, #703): one map lookup in each of four commit sections that already hold the lock (wake, cold-boot wake, wake of an archived claim, resize); the readers (renew, liveness, move) do the same lookup plus field reads. pauseArchive reads one map entry in a section that already holds the lock, and archive() takes the lock once more per archive job. Nothing on the claim path.
Cleanup (#694): not benchmarked. The changed lines on a repeated path: the digest of an archive hashes one write per file frame instead of five, with one buffer reused across files (the hashed bytes are unchanged); SetTun computes one boolean more under a lock it already holds and takes one lock fewer; the egress upstream copy hands the buffered bytes and then the connection to the same writers in the same order; the probe MAC on the heal path builds its 8-byte bucket as a slice instead of an array. The gates (lint, tests with -race, both platforms) pass on it.
Dependency round: not measured.
Known limits
A guest can fill its own boot door's backlog by opening connections to port 2054 and writing nothing (#671, open). On a Cloud Hypervisor build whose vsock muxer connects to host sockets with a blocking connect (v55.0 among them), its VMM then blocks, its silkd goes silent and silent-guest recovery cold-boots it, and a hung guest that is then hibernated or saved holds one of the node's 8 memory-dump slots until the dump times out (15 min). On a build with the non-blocking connect, a full backlog only refuses that guest's own boot notices. A VM keeps the build it started with. The VMM's fd limit is not checked.
A preview reply can still be cut in two cases (docs, deploy page, "Early replies"): a guest that closes its connection with part of the upload unread, where its reset can overtake the reply (#689, lowered by #691, not removed: guest closes, declared 1 MiB upload, 256 KiB reply, cut 13 and 19 of 30 against 29 and 30 in v0.1.39; 0 to 2 with a 64 KiB reply against 17 to 23), and a client that reads nothing until it has written its whole upload, when the reply does not fit its receive buffer and more than about 256 KiB of the upload is still unread by the node.
An Expect upload that the guest refuses before the node's first read of its body can still get a cut reply (a small refusal arrives whole; with a 64 KiB refusal and a declared 16 KiB upload none was cut in 60 runs against 7 in v0.1.39, and with a declared 256 KiB upload 3 and 2 of 60 against 2 and 2; #690's closing comment). Clients that send Expect are rare (browsers do not; curl only above 1 MiB), and hardware reached this path in 0 of 100 refusals.
An Expect upload that pauses after its 100 Continue gets its early reply only when it sends more of the upload or closes, unless the reply is short and declares its length (#692; docs by #693, no code change). The reply is delayed by the client's own pause, not lost.
Archive mark, windows kept without a fix:
A claim a wake took and that is hibernated again before its job runs counts as archiving until the job gives it up: renew answers 409 and a move is refused for that time.
An operator change after the mark (archive_after set to 0, a tenant removed, replication switched) does not stop that one archive; the job reads the claim's shape and its mark, not the policy again.
The expired-row job still ignores a taken mark (#705, open): a replicated, hibernated claim past its lease that does not archive, woken between the job's mark and the job, runs on but loses its replica and row until the next replication round.
Resize keeps 13 accepted gaps, each with its reason, in section 7 of sandboxd/pool/CHECKLIST.md; among them, a caller on the TryLock fast path of a data-plane call, the passive dial or PUT /instance-metadata that stalls between its lookup and the lock for the whole resize still reaches the old record. A lease that goes overdue between the two fence checks answers 503 lease lost; retry after cocoon resized the VM: the VM has the new size and the record the old one, a wake restores the old size and a later resize works.
One case of the egress relay (#681) waits where v0.1.38 delivered the reply: the upstream stops reading its request after it answered and keeps the connection open, the guest sends its whole request before it reads anything, the up to 256 KiB left unread do not fit in the buffers on the path, and the reply is larger than the buffering towards the guest. Both sides then wait until the upstream or the guest gives up; no server timeout bounds it. With more than 256 KiB unread, v0.1.38 already waited this way, and servers that answer early normally read or discard the rest of the request.
Egress usage after an early upstream reply: the usage row and the upstream's own byte count can differ by one read, at most 32 KiB (measured in 800 probe runs: one read forwarded past the row in one run, and in 561 the row held one read the upstream never received).
A claim whose transition lock is held during the hourly archive-row sweep is reconciled up to an hour later (#674).
cbe59f7 pool: a claim a wake or a resize took from an archive job no longer counts as archiving (#696)
f23328d pool: a volume run no longer checks that it is the registered run (#686)
a7d17b8 pool: an archive job leaves a claim a wake took since it was marked (#703)
c6304c4 pool: root's by-id read serves a root-adopted claim's minted token, and the claim answers it (#682)
d603682 pool: the lock-waiter test helper reads the whole goroutine dump (#704)
1fc9096 preview: an early reply is relayed whole and closes the connection; the proxy aborts the upload when the handler ends instead of waiting for it (#691)