Repository navigation
follow-up: off-loop reader teardown, one upload rebind, Python dial-failure parity, reap log out of the lock - #487
Merged
Merged
Conversation
Folding the failed-mark filter into the keep loop moved one Error line per expiring archive under m.mu; with the checkpoint store down that is thousands of lines on every reap tick, held against the claim path.
dropStaleReaders ran cocoon vm rm for each stale reader on the Run loop itself, so a wave of wakes with open reader connections stalled refill and liveness behind serialized engine removals.
…s not delivered _claim_refused accepted only a refused connection or a DNS failure, so a candidate on a dead host (EHOSTUNREACH, connect timeout) stopped the redirect walk while the Go SDK moved on; the client now connects explicitly and tags any connect failure, TLS included, as a dial error.
WriteFile's retryMoved and uploadRPC's own deferred rebind each ran a full Lookup when the owner was gone, doubling the failure latency; only Push, which never retries, rebinds after its upload now.
…ted (exported above unexported)
…PoolSpec one receiver kind
…p godocs that restate their code
…s are tagged Wrapping connect failures in _DialError hid the ConnectionRefusedError that _owner_answer checks, so fork, renew, hibernate, checkpoint, promote, preview and volume calls stopped following a sandbox off a retired node.
…buffers fs.replace cloned the Regex per file, and a regex clone builds a fresh cache pool, so every file restarted the lazy DFA cold; an Arc shares one pool across the blocking tasks. fs.read dropped its full head buffer and frame and stream_data_frames allocated new ones, about 600 KiB per large read; both are passed in now.
…ng comments, trim the smoke doc and the single-lookup test
…-gone stdin test hangs up The test dropped the client after the first stdout frame; on a loaded runner the group SIGKILL could land before perl ran setpgrp, killing the child that writes the result, and the test waited out its 30 s deadline. Reproduced by delaying setpgrp 0.5 s; the child now marks itself ready after setpgrp and the test waits for that mark.
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.
Follow-up to #486. Two independent read-only reviews of the merged diff and one hot-path performance review raised the items below. Each was checked against the source before it was changed.
Fixes (each with a regression test that fails on main)
pool: retire stale readers through the bounded maintenance fan-outdropStaleReadersrancocoon vm rmfor every stale reader on the Run loop itself, so refill, liveness and reap stalled behind serialized engine removals.TestStaleReaderTeardownNeverBlocksTheCaller(on main the call blocks on a stalled removal)sdk/go: rebind a failed upload onceWriteFileranLookuptwice on an owner-gone error: once fromretryMoved, once fromuploadRPC's own deferred rebind. That doubles the failure latency.TestAWriteToAGoneSandboxLooksItsOwnerUpOnce(main: 2 owner probes)sdk/python: treat any connect-phase failure of a redirect candidate as not delivered_claim_refusedaccepted only refused or DNS failures, so a candidate on a dead host (EHOSTUNREACH, connect timeout) stopped the redirect walk while the Go SDK moved on. The client now connects explicitly and tags every connect failure, TLS included, as a dial error.test_claim_redirect_skips_an_unreachable_candidatesdk/python: a refused owner still counts as gone once connect failures are taggedConnectionRefusedErrorthat owner-gone tagging checks, so control calls stopped following a sandbox off a retired node.test_a_moved_sandbox_retries_a_control_call_at_its_new_owner[old_node_retired]silkd: share one compiled regex across a replace and reuse fs.read's buffersfs.replacecloned theRegexper file (a clone builds a fresh cache pool, so the lazy DFA restarted cold per file);fs.readdropped its full head buffer and frame and reallocated about 600 KiB per large read.read_streams_files_around_the_first_chunk_bound,replace_*pool: log failed reap marks before taking the manager lockm.mu. With the checkpoint store down, that is thousands of lines per reap tick held against the claim path.Flaky test fixed
a_client_gone_mid_output_releases_the_stdin_a_forked_child_holds(since #420) dropped the client right after the first stdout frame. On a loaded runner the group SIGKILL could land before the forked perl ransetpgrp, so the child that writes the result died and the test waited out its 30 s deadline. This failed once on this PR's CI. Reproduced locally by delayingsetpgrp0.5 s. The child now marks itself ready aftersetpgrp, the test waits for that mark, and the test passes with the injected delay.Style
pty_namemoved below the public helpers;tokio::process::Childimported.sandbox_iddescription named once.PoolSpec.ValidateLimitsgets a pointer receiver like its siblings.sandbox-mcp.egresssmokeandrpcbenchstay multi-line: they carry a config example and usage the code cannot show.openStream,waitArchived,noteArrivaland three others inwatermark.go, ptydrain); tokio process types imported where silkd spelled them out.Reviewed and left as is
log.WithFuncto the top ofhandleExec,wakeGuest,router.failandserveTun. These run per request or per connection, and building the logger only on the error branch keeps the success path allocation-free.tenants/pgslices.AppendSeq([]string{}, …): an empty set must bind as'{}', not NULL.claim.go's compare-then-write ofsb.Replicated: the field is read without the lock.Numbers (origin/main..HEAD)
Comment lines: 20 added, 81 removed. The 20 added are one-line package docs that replace longer ones and moved lines.
Checks run
make go-lint:0 issues.×10.aslon both GOOS: clean.go test -race -count=1 ./...passes in all modules.-D warningsand tests pass on macOS (178) and in arust:1.99.1linux/arm64 container (180).sdk/pythonhas 294 passing; ruff passes.