GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — plumbing: format/packfile, use ReadAt in FSObject.Reader() for concurrency safety. by cedric-appdirect · Pull Request #1998 · go-git/go-git Conversation
Contributor
Replace Seek+Read with io.SectionReader backed by ReadAt in FSObject.Reader(). ReadAt does not modify the file's seek cursor (it maps to pread(2) on POSIX), so multiple goroutines can safely call Reader() on FSObjects that share the same packfile handle. The billy.File interface already requires io.ReaderAt, and both osfs (via os.File) and memfs implementations are documented as safe for concurrent ReadAt calls. The closed-file recovery path now uses a 1-byte ReadAt probe instead of Seek to detect stale descriptors without mutating shared state. A zero-length ReadAt is insufficient because os.File returns (0, nil) for empty reads even on closed files. This PR is necessary to enable parallel checkout from PR #1749 which will help resolving #1956 Assisted-by: OpenCode with Claude Opus 4.6 [email protected]
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
cedric-appdirect
force-pushed
the
fsobject-readerat
branch
from
aeea23a to
294da28
Compare
cedric-appdirect
force-pushed
the
fsobject-readerat
branch
4 times, most recently
from
77aa230 to
bdd7073
Compare
cedric-appdirect
force-pushed
the
fsobject-readerat
branch
from
bdd7073 to
af503bd
Compare
pjbgf
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cedric-appdirect thanks for working on this, below are a few nits.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
cedric-appdirect
force-pushed
the
fsobject-readerat
branch
from
af503bd to
4843eb2
Compare
pjbgf
reviewed
Uh oh!
There was an error while loading. Please reload this page. …rency safety. Replace Seek+Read with io.SectionReader backed by ReadAt in FSObject.Reader(). ReadAt does not modify the file's seek cursor (it maps to pread(2) on POSIX), so multiple goroutines can safely call Reader() on FSObjects that share the same packfile handle. The billy.File interface already requires io.ReaderAt, and both osfs (via os.File) and memfs implementations are documented as safe for concurrent ReadAt calls. The closed-file recovery path now uses a 1-byte ReadAt probe instead of Seek to detect stale descriptors without mutating shared state. Non-ErrClosed errors from the probe are propagated to the caller. A zero-length ReadAt is insufficient because os.File returns (0, nil) for empty reads even on closed files. Assisted-by: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Cedric BAIL <[email protected]> Co-authored-by: Cursor <[email protected]>
cedric-appdirect
force-pushed
the
fsobject-readerat
branch
from
4843eb2 to
c37bc6f
Compare
pjbgf
approved these changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cedric-appdirect thanks for working on this. 🙇
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
1 of 8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |