fix: release idle upstream conns on egress Close; skip unreadable subdirs in fs.find - #124
Merged
Merged
Conversation
…dirs in fs.find egress: each sandbox's Proxy owned two http.Transports with no idle timeout, and Close never closed their idle pool, so a released claim left its upstream keep-alive connections and their read loops behind. Close now drops the idle pool and both transports expire idle connections after 90 s. silkd: fs.find returned a terminal error frame when read_dir failed on a subdirectory it had already queued, while an unreadable file was skipped; a tree changing under a running find (a build removing a directory) lost the whole search mid-stream. Only the root directory is fatal now; a queued subdirectory that cannot be opened is skipped.
…le in the fake A read_dir error on the requested root after partial enumeration was folded into the subdirectory skip and answered done with a truncated result; the root stays fatal, only queued subdirectories are skipped. The Go silkdtest fake now applies the same rule so the SDK tests see what silkd does.
…M transport cloned The nested-loop rewrite hid the success return three levels deep; the original while-let carries the root-fatal / subdirectory-skip split as two match guards. The directory stack held re-encoded Strings while ent.path() already owned a PathBuf. The fake's SkipDir branch could not differ from nil: WalkDir revisits a directory only after its ReadDir failed. The MITM transport re-spelled the base transport's fields.
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.
sandboxd/egress
Proxybuilds twohttp.Transports per sandbox (tr,mitmTr) withIdleConnTimeoutunset andCloseonly closed the hijacked tunnels, never the transports' idle pool. Upstream keep-alive connections (and theirreadLoopgoroutines, which pin the transport) outlived the released claim; nothing in the module calledCloseIdleConnections.Closenow drops the idle pool on both transports, and both expire idle connections after 90 s.TestCloseReleasesIdleUpstreamConns: one proxied GET, thenClose; the upstream'sConnStatemust observeStateClosed. With theCloseIdleConnectionscalls removed the test reportsupstream connection still open after Close.silkd/src/find.rs
fs.findtreated aread_dirfailure on a queued subdirectory as fatal (err_framemid-stream, after matches had already shipped) whilescan_filedeliberately skips unreadable files. An agent grepping a tree that a build is mutating lost the whole search. The root directory stays fatal (a bad path is a request error); a queued subdirectory that cannot be opened, or whose iteration fails, is skipped.Gates
GOWORK=off make go-lint: 0 issues ×10 (5 modules × linux/darwin).asl ./...in sandboxd both GOOS: clean.make lint+make test(boot/init + silkd, fmt/clippy/test): green.make go-test: green.