Repository navigation
uffd-handler: the first peer dial waits for the source's capture - #1786
Merged
Merged
Conversation
The destination's handler dials the source before the source pauses the guest. The source holds that Hello until the capture registers the export, and before it pauses it waits for the destination to finish its disk precopy. The handler read HelloAck with the 5 s page-channel timeout, so a capture later than 5 s after the dial ended the handler with EAGAIN and the restore failed with postcopy-never-loaded. The Firecracker root lane showed this as an intermittent failure of the two-host live teleport tests. The first dial now waits for HelloAck for the source's park budget plus one page timeout, so the source's own answer arrives first when the export never registers. The page timeout applies again from Seal on. Redials and worker connections keep the 5 s limit: their export exists. The park budget is one constant in engram-migrate-proto, read by the server and the client. Review pass: handshake() is split from the dial so the wait is an argument of one function, not of each dial helper. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNhpmz4QPYaVCE7tFna54D
The test set a 50 ms attempt deadline to end a hung first attempt. The same deadline applied to the retry, which reads a local file. On a loaded macOS runner that read took longer than 50 ms and the test failed with 'attempt deadline 0.05s exceeded'. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNhpmz4QPYaVCE7tFna54D
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.
Problem
The Firecracker root lane fails intermittently in the two-host live teleport tests:
The handler log in that error is new, and it names the cause.
The destination's memory handler dials the source before the source pauses the guest. The source holds that
Hellountil the capture registers the export (its budget is 120 s). Before the source pauses, it also waits for the destination to finish its disk precopy and ask for the VM state. The handler readHelloAckwith the 5 s page-channel timeout. A capture that registers its export more than 5 s after the dial ends the handler withEAGAIN, and the restore fails.This is a product defect, not only a test defect: a move whose destination needs more than 5 s between the handler's dial and the source's capture fails the same way, and the coordinator aborts it to the source.
Change
HelloAckfor the source's park budget plus one page timeout. When the export never registers, the source's ownErroranswer arrives first.Sealon. Redials and worker connections keep the 5 s limit, because their export exists.EXPORT_PARK_BUDGETinengram-migrate-proto, read by the server and the client.handshake()is split from the dial, so the wait is an argument of one function.A handler that waits on a source that died is still bounded: TCP keepalive is set on the socket before the handshake, and the host-agent's load gate ends the restore.
Tests
the_ack_wait_bounds_only_the_wait_for_hello_ack: a source that answers 300 ms late fails a 50 ms wait, passes a longer wait, and the socket then has the page timeout.the_first_dial_outlasts_the_source_park_budget.🤖 Generated with Claude Code
https://claude.ai/code/session_01HNhpmz4QPYaVCE7tFna54D