git.status caps its frame; find streams to the caller - #129
Merged
Conversation
A status of a large tree rendered one frame past the cap and dropped the connection with no terminal frame. The entry list now stops at an eighth of the frame cap in estimated bytes and the result carries truncated: true, so the head of the list still arrives. The Go SDK gains FindSeq and the Python SDK find_iter: matches stream to the caller, and leaving the loop closes the connection, which ends the walk in the guest, so the caller bounds the result instead of accumulating it. Find keeps its slice API on top of the same stream.
A caller that stops reading after an early match left silkd scanning the rest of the tree whenever no further match tried to write; the writer now selects on the request side as watch does, so EOF or a stray frame ends the walk without a done frame. The find e2e tests keep their write half open until the terminal frame, the way the SDKs do. The SDK examples handle the error before the result-limit break, and the Python one closes the generator explicitly.
Ending the writer loop closed the budget, but a walker scanning a tail with no matches only noticed at its next send, so an abandoned find still read the whole tree. The walk now tests the channel before each entry and reports whether it completed. The Python example imports closing and the docstring names contextlib.closing as the portable cleanup.
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.
Supersedes #128 (same two commits rebuilt on main after #127, plus the disconnect fix its review asked for).
git_statuson a large tree (about 100k changed or untracked files) rendered one frame past the 8 MiB cap, so the writer failed and the connection dropped with no terminal frame. The entry list now stops at an eighth of the frame cap in estimated bytes and the result carriestruncated: true; the head of the list still arrives, and the field is absent when nothing was cut. Fixtureresp_git_status_result_truncated.jsonpins the shape on both sides.Findaccumulated every match on the host with no bound. The Go SDK gainsFindSeq(aniter.Seq2over the same stream; breaking out closes the connection) and the Python SDKfind_iter;Find/findkeep their slice APIs on top of the stream. In silkd,findnow selects on the request side the waywatchdoes, so a client that went away ends the walk even when no further match would have tried to write; the e2e tests keep their write half open until the terminal frame, as the SDKs do.Gates: cargo fmt/clippy/test (macOS and a
rust:1.98.0linux/arm64 container),make lintboth GOOS, Go tests in every module, Python suite 154 passed, ruff check clean.