-
Notifications
You must be signed in to change notification settings - Fork 92
use exact read size to acquire from io semaphore #9287
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughReplaces several verbose debug logs with lower-verbosity logs across upload/read paths, adds an early-termination guard in read_object_stream, adjusts IO semaphore sizing to use requested_end - reader.pos, adds an explicit re-throw in upload error handling, and inserts a few additional log lines and a minor comment formatting change. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| // instead of getting multiple calls from the stream with small slices to return. | ||
|
|
||
| const requested_end = Math.min(params.end, reader.pos + requested_size); | ||
| if (requested_end <= reader.pos) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking here, maybe the logic will be clearer:
if (requested_size === 0 || reader.pos >= params.end) {
As this will give us more understanding that reading is finished
alphaprinz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. LGTM.
re Jacky's comment, can't say I have a preference. Options are equivalent and both make sense.
- In read_object_stream, we used the requested_size passed to the _read function as the value to acquire from the io semaphore. By default, this is 32 MB (the stream's highWaterMark). - For datasets with mostly small objects, this limits the number of concurrent reads more than necessary. - Changed io_sem_size to reflect the actual size requested by the current read. - Also, avoid entering the code under the semaphore if there is nothing more to read. - changed debug level of some read\upload messages to log1 instead of log0 Signed-off-by: Danny Zaken <[email protected]>
4abf62d to
f4918af
Compare
Describe the Problem
Explain the Changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
Summary by CodeRabbit
Bug Fixes
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.