Skip to content

fix: avoid scheduler deadlock on same-priority chunks#7588

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/fix-scheduler-backpressure
Jul 6, 2026
Merged

fix: avoid scheduler deadlock on same-priority chunks#7588
Xuanwo merged 1 commit into
mainfrom
xuanwo/fix-scheduler-backpressure

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

This fixes a scanner hang when a ranged read starts at a write-batch boundary and a wide column is split into multiple I/O chunks while another smaller, higher-priority request is scheduled in the same scan line.

The scheduler previously used only the minimum in-flight priority to decide whether a request could bypass byte backpressure. If a higher-priority request remained unconsumed while the decoder awaited a wide-column request, remaining chunks from the already-admitted wide-column request could be blocked behind the byte budget, causing a deadlock.

This changes both the standard and lite schedulers to let chunks with an already in-flight priority keep moving. It also adds scheduler-level and scanner-level regression coverage, and updates the io_buffer_size docs now that this deadlock is fixed.

Validated with the relevant lance-io scheduler tests and the targeted scanner regression.

@github-actions github-actions Bot added A-python Python bindings A-encoding Encoding, IO, file reader/writer bug Something isn't working labels Jul 2, 2026
@Xuanwo Xuanwo marked this pull request as ready for review July 2, 2026 14:32
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.70732% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance-io/src/scheduler.rs 77.61% 15 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wjones127 wjones127 self-assigned this Jul 2, 2026
@wjones127 wjones127 self-requested a review July 2, 2026 21:31
@Xuanwo Xuanwo merged commit 4f39296 into main Jul 6, 2026
30 checks passed
@Xuanwo Xuanwo deleted the xuanwo/fix-scheduler-backpressure branch July 6, 2026 05:32
@westonpace

Copy link
Copy Markdown
Member

Hmm, too late to chime in but I wonder if there is a way we could have made all parts of the logical request have the same priority? Where was this split happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer A-python Python bindings bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants