fix(file): fix read performance regression from RangeReader change#938
Open
maggch97 wants to merge 1 commit intofclairamb:mainfrom
Open
fix(file): fix read performance regression from RangeReader change#938maggch97 wants to merge 1 commit intofclairamb:mainfrom
maggch97 wants to merge 1 commit intofclairamb:mainfrom
Conversation
The RangeReader commit (fclairamb#922) changed Read() to request only len(p) bytes per call instead of streaming from offset to end-of-file. This caused every Read() call to open a new HTTP connection to S3, resulting in hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB file with 32KB buffers instead of 1). Fix by requesting from current offset to end-of-file when opening a read stream, and properly closing the stream on Seek() so the next Read() opens a new stream from the correct position. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
maggch97
added a commit
to maggch97/vikunja
that referenced
this pull request
Feb 27, 2026
The upstream afero-s3 library has a severe performance regression where every Read() call opens a new HTTP connection to S3, resulting in hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB file with 32KB buffers instead of 1). This temporarily replaces afero-s3 with a fork that fixes the issue by requesting from the current offset to end-of-file when opening a read stream, and properly closing the stream on Seek(). Upstream PR: fclairamb/afero-s3#938 This replace directive should be removed once the upstream PR is merged and a new version is released. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kolaente
pushed a commit
to go-vikunja/vikunja
that referenced
this pull request
Mar 3, 2026
…2313) The upstream afero-s3 library has a severe performance regression where every Read() call opens a new HTTP connection to S3, resulting in hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB file with 32KB buffers instead of 1). This temporarily replaces afero-s3 with a fork that fixes the issue by requesting from the current offset to end-of-file when opening a read stream, and properly closing the stream on Seek(). Upstream PR: fclairamb/afero-s3#938 This replace directive should be removed once the upstream PR is merged and a new version is released.
3 tasks
tink-bot
pushed a commit
to go-vikunja/vikunja
that referenced
this pull request
Mar 26, 2026
…2313) The upstream afero-s3 library has a severe performance regression where every Read() call opens a new HTTP connection to S3, resulting in hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB file with 32KB buffers instead of 1). This temporarily replaces afero-s3 with a fork that fixes the issue by requesting from the current offset to end-of-file when opening a read stream, and properly closing the stream on Seek(). Upstream PR: fclairamb/afero-s3#938 This replace directive should be removed once the upstream PR is merged and a new version is released.
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.
The RangeReader commit (#922) changed Read() to request only len(p) bytes per call instead of streaming from offset to end-of-file. This caused every Read() call to open a new HTTP connection to S3, resulting in hundreds of requests for sequential reads (e.g. ~320 requests for a 10MB file with 32KB buffers instead of 1).
Fix by requesting from current offset to end-of-file when opening a read stream, and properly closing the stream on Seek() so the next Read() opens a new stream from the correct position.