Conversation
…rame writes Found by running a node in a 1 GB container under load. - Several transfers of the same content at once failed: the .partial is named after the content hash, so they shared one file and all but the first failed at the final rename. The first transfer keeps the resumable .partial; a concurrent one gets a private file, removed if it does not finish. - A file that cannot fit on the receiver's disk is refused at INIT (16 MiB kept in reserve) instead of running until the disk is full. If a write still hits ENOSPC the .partial is deleted rather than left holding the disk full. - A refusal at INIT is reported as a refusal. The sender took it for a receiver without streamed-transfer support, and the caller fell back to pushing the whole file in one frame. - WriteFrame sends a frame of up to 64 KiB as one write, so the payload is not held behind the header by Nagle and the peer's delayed ACK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
9 of 12 tasks
TeoSlayer
marked this pull request as draft
October 1, 2026 15:14
Contributor
Author
|
Converted to draft after review; two things to fix before this merges (nothing ships until a stable tag, but both are regressions against main).
The rest reviewed well: wire bytes are unchanged, |
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.
Summary
Four fixes to file transfer and framing, found by running a node in a 1 GB container under load.
Changes
.partialis named after the content hash so a retry can resume it. Two peers sending the same file (or one sender on two connections) therefore wrote the same file, and all but the first failed at the final rename. The first transfer keeps the resumable.partial; a concurrent one gets a private file, removed if it does not finish..partial, where they kept the disk full and blocked incoming messages. If a write still hitsENOSPC, that.partialis deleted.WriteFramesends a frame of up to 64 KiB as one write. Header and payload as two writes made the payload wait on Nagle and the peer's delayed ACK.Wire format is unchanged. The free-space check uses
statfson unix and is skipped elsewhere.Test Plan
go build ./...,go vet ./...go test ./... -count=1and-race.partial; a transfer is refused when free space is one byte short and accepted when it fits; a disk-full write removes the.partialwhile other write errors keep it; small frames are one write and round-trip.🤖 Generated with Claude Code