refactor(driver): handle panicking#853
Merged
George-Miao merged 1 commit intocompio-rs:masterfrom Apr 13, 2026
Merged
Conversation
125e9b9 to
b1a64aa
Compare
5 tasks
b1a64aa to
441e9f3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the driver’s blocking-operation execution so panics in the thread pool are caught, converted into an io::Error, and then re-raised (resumed) on the consumer thread when the result is popped—preventing a worker panic from taking down the pool.
Changes:
- Add panic utilities (
catch_unwind_io/resume_unwind_io) to convert panics intoio::Resultand later resume unwinding. - Wrap blocking-operation execution in
catch_unwind_ioacross poll/io_uring/IOCP backends. - Update
Proactor::pop/pop_with_extrato resume unwinding when a panic-originated error is observed; add a regression test.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| compio-driver/tests/asyncify.rs | Adds a test covering panic behavior in Asyncify/thread-pool execution and tweaks polling behavior in the helper. |
| compio-driver/src/sys/poll/mod.rs | Wraps blocking operate() execution in catch_unwind_io before reporting completion. |
| compio-driver/src/sys/iour/mod.rs | Wraps blocking fallback execution in catch_unwind_io before reporting completion. |
| compio-driver/src/sys/iocp/mod.rs | Wraps blocking execution paths in catch_unwind_io before posting/completing results. |
| compio-driver/src/panic.rs | Introduces panic<->io::Result conversion helpers and a wrapper error type. |
| compio-driver/src/lib.rs | Resumes unwinding in pop and pop_with_extra when the completion represents a panic. |
| compio-driver/src/asyncify.rs | Minor style-only change in worker loop body. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
22830ac to
c0b0733
Compare
Member
Author
|
Don't know why iocp driver is not catching the panic... |
Member
|
See |
67993a8 to
a87eb05
Compare
415182d to
bc35466
Compare
bc35466 to
0e92075
Compare
Berrysoft
approved these changes
Apr 13, 2026
Open
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.
Closes #791