Skip to content

feat: clamp zero I/O concurrency#6332

Merged
joseph-isaacs merged 1 commit intovortex-data:developfrom
caicancai:fix/segment-source-concurrency-clamp
Feb 6, 2026
Merged

feat: clamp zero I/O concurrency#6332
joseph-isaacs merged 1 commit intovortex-data:developfrom
caicancai:fix/segment-source-concurrency-clamp

Conversation

@caicancai
Copy link
Copy Markdown
Contributor

This PR adds a small safety guard in FileSegmentSource::open(): if VortexReadAt::concurrency() returns 0, we log a warning and clamp it to 1. This avoids potential stalls or panics from calling buffer_unordered(0) while keeping normal behavior unchanged for valid concurrency values.

@caicancai caicancai force-pushed the fix/segment-source-concurrency-clamp branch from a4d49ae to 6bcc680 Compare February 6, 2026 03:12
Comment thread vortex-file/src/segments/source.rs Outdated
Comment on lines +89 to +96
let raw_concurrency = reader.concurrency();
if raw_concurrency == 0 {
tracing::warn!(
uri = ?reader.uri(),
"VortexReadAt::concurrency returned 0; clamping to 1 to avoid stalling I/O"
);
}
let concurrency = raw_concurrency.max(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just panic here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review, done.

@caicancai caicancai force-pushed the fix/segment-source-concurrency-clamp branch from 6bcc680 to 299dd0b Compare February 6, 2026 10:27
Comment thread vortex-file/src/segments/source.rs Outdated
@@ -87,6 +87,12 @@ impl FileSegmentSource {
config
});
let concurrency = reader.concurrency();
if concurrency == 0 {
panic!(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vortex_panic! please

Copy link
Copy Markdown
Contributor Author

@caicancai caicancai Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned something, thank you.

Signed-off-by: cancaicai <2356672992@qq.com>
@caicancai caicancai force-pushed the fix/segment-source-concurrency-clamp branch from 299dd0b to fa33a1b Compare February 6, 2026 14:22
@joseph-isaacs joseph-isaacs enabled auto-merge (squash) February 6, 2026 15:28
@joseph-isaacs joseph-isaacs added the changelog/chore A trivial change label Feb 6, 2026
@joseph-isaacs joseph-isaacs merged commit e061c55 into vortex-data:develop Feb 6, 2026
52 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants