Conversation
A queue size of 0 will cause hanging in the file transfer process.
📝 WalkthroughWalkthroughThe pull request modifies the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
This inadvertently caused file transfers to hang when used in conjunction with `http-connections = 0`: the worker checks if the in-progress items and items we've added to the incoming queue are larger than the max queue size, which was previously defined to be 5x the value of `http-connections. Well, as you can probably tell, 5*0=0, and unless the `.size()` of any of these containers became negative, we would always wait another 100ms instead of processing the incoming queue. Because `http-connections = 0` is a special value to signal, roughly, "as much possible" (mostly depends on how cURL handles it, but this is probably approximately right), we default to `std::thread::hardware_concurrency()` (as is done in a couple other places; specifically, this is what the ThreadPool constructor does for a value of `0`). There may be a better fix, but this works for now, and is approximately right.
5b4a357 to
116b10a
Compare
grahamc
approved these changes
Jan 27, 2026
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.
Motivation
This inadvertently caused file transfers to hang when used in conjunction with
http-connections = 0: the worker checks if the in-progress items and items we've added to the incoming queue are larger than the max queue size, which was previously defined to be 5x the value ofhttp-connections. Well, as you can probably tell, 5*0=0, and unless the.size()` of any of these containers became negative, we would always wait another 100ms instead of processing the incoming queue.Because
http-connections = 0is a special value to signal, roughly, "as much possible" (mostly depends on how cURL handles it, but this is probably approximately right), we default tostd::thread::hardware_concurrency()(as is done in a couple other places; specifically, this is what the ThreadPool constructor does for a value of0).There may be a better fix, but this works for now, and is approximately right.
Context
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.