Skip to content

fix(driver): key is not unique when spawn_blocking - #675

Merged
George-Miao merged 5 commits into
compio-rs:masterfrom
George-Miao:fix/driver/key-dup-blocking
Feb 12, 2026
Merged

George-Miao merged 5 commits into
compio-rs:masterfrom
George-Miao:fix/driver/key-dup-blocking

Conversation

@George-Miao

@George-Miao George-Miao commented Feb 12, 2026 •

Copy link
Copy Markdown
Member

Closes #674.

Old implementation creates a new closure everytime threadpool is full, which creates a new clone of Key and freezes it. This leaks the key and causes panic. This PR also replaces Arc<SegQueue> with flume in blocking threadpool, I'm not sure about performance impact though.

Copilot AI review requested due to automatic review settings February 12, 2026 00:23
@George-Miao George-Miao added the driver: io-uring About the io-uring driver label Feb 12, 2026
@George-Miao George-Miao self-assigned this Feb 12, 2026
@George-Miao George-Miao added the bug Something isn't working label Feb 12, 2026

Copilot AI left a comment

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.

Pull request overview

This PR fixes a panic/logic error in the io-uring driver where blocking operations dispatched to the thread pool could leave a Key in a non-unique/leaked state when dispatch fails (e.g., pool saturated), leading to "Key not unique" at result take time.

Changes:

  • Replace SegQueue-based completion collection with a flume channel for completed blocking entries.
  • Refactor blocking dispatch to retry AsyncifyPool::dispatch without dropping the frozen key/closure on failure.
  • Minor logging/comment wording tweaks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread compio-driver/src/sys/iour/mod.rs Resolved
Comment thread compio-driver/src/sys/iour/mod.rs Resolved
@George-Miao George-Miao changed the title fix(driver,iour): key not unique when spawn_blocking fix(driver): key not unique when spawn_blocking Feb 12, 2026
@George-Miao
George-Miao force-pushed the fix/driver/key-dup-blocking branch from 379ebf2 to e3d664f Compare February 12, 2026 02:23
@George-Miao George-Miao changed the title fix(driver): key not unique when spawn_blocking fix(driver): key is not unique when spawn_blocking Feb 12, 2026
@George-Miao
George-Miao merged commit b9012d2 into compio-rs:master Feb 12, 2026
56 checks passed
@George-Miao
George-Miao deleted the fix/driver/key-dup-blocking branch February 12, 2026 03:30
@github-actions github-actions Bot mentioned this pull request Feb 12, 2026
Berrysoft pushed a commit that referenced this pull request Feb 12, 2026
* fix(driver,iour): key not unique when spawn_blocking

* feat: no busy spin

* feat: add test for small pool

* fix(driver,iocp): push_blocking stuck

* fix: poll
This was referenced Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working driver: io-uring About the io-uring driver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants