cancelIo fix - cancellation sqe should be sent to the same ring as the original sqe#59
Merged
Conversation
vadimskipin
reviewed
Jun 1, 2026
There was a problem hiding this comment.
Pull request overview
This PR fixes cross-fiber I/O cancellation with io_uring by ensuring the cancel SQE is submitted to the same per-CPU ring that originally holds the operation’s SQE, preventing -ENOENT cancels that can leave waiters blocked indefinitely.
Changes:
- Track which processor/ring an
IoFuturewas submitted to (IoFuture::submitProcessor). - Route
cancelIo()submissions to the recorded ring and, when cancelling remotely, force-submit and wake the target processor thread. - Add a regression test that cancels a
POLL_ADDfrom a different fiber (likely on a different CPU due to work-stealing).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/fibers/fiber.cpp |
Records SQE submit ring and routes cancel SQEs to the correct per-CPU io_uring ring. |
include/silk/fibers/fiber.h |
Extends IoFuture with submitProcessor to support correct cancel routing. |
src/fibers/tests/fiber-test.cpp |
Adds a cross-fiber cancellation regression test for poll()/cancel(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vadimskipin
reviewed
Jun 1, 2026
vadimskipin
reviewed
Jun 1, 2026
2b7868d to
f791d77
Compare
vadimskipin
previously approved these changes
Jun 1, 2026
f791d77 to
a5bf0e0
Compare
vadimskipin
approved these changes
Jun 1, 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.
Otherwise cancellation returns
ENOENTut added