-
Notifications
You must be signed in to change notification settings - Fork 89
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
- 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]>
WalkthroughModifications to object stream IO handling include converting verbose debug logs to less verbose levels across upload and read operations, adding early-termination logic in read_object_stream, adjusting IO semaphore sizing calculation, and adding explicit error re-throwing in the upload path. 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)
⏰ 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)
🔇 Additional comments (8)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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.
Describe the Problem
Explain the Changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor