Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): read exact chunk len #7777

Merged
merged 3 commits into from Apr 22, 2024
Merged

fix(cli): read exact chunk len #7777

merged 3 commits into from Apr 22, 2024

Conversation

emhane
Copy link
Member

@emhane emhane commented Apr 20, 2024

Bug: reads capped by File, supposed to be capped by user

  • Replaces read_buf with read_exact to ensure the whole chunk length is read from file. This will crash otherwise if the whole file length is passed as chunk length.
  • Adds tracing
  • With this fix, ChunkedFileReader now reads (big) user defined chunks from file, as it was intended to.

BufReader can improve the speed of programs that make small and repeated read calls to the same file or network socket. It does not help when reading very large amounts at once, or reading just one or a few times.

(src: https://doc.rust-lang.org/std/io/struct.BufReader.html)

@emhane emhane added C-bug An unexpected or incorrect behavior A-observability Related to tracing, metrics, logs and other observability tools A-cli Related to the reth CLI labels Apr 20, 2024
@mattsse mattsse added this pull request to the merge queue Apr 22, 2024
@mattsse mattsse removed this pull request from the merge queue due to a manual request Apr 22, 2024
@emhane emhane enabled auto-merge April 22, 2024 13:26
@emhane emhane added this pull request to the merge queue Apr 22, 2024
Merged via the queue into main with commit 24a8202 Apr 22, 2024
27 checks passed
@emhane emhane deleted the emhane/fix-import branch April 22, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI A-observability Related to tracing, metrics, logs and other observability tools C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants