Conversation
31b352d to
169821a
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors finish-handle cancellation to route io_uring cancel requests through Runtime::cancel() (instead of directly submitting a cancel SQE from the handle), introduces a shared OpFinishHandleBase header, and updates concepts/tests to match the new cancel(Runtime*) shape.
Changes:
- Extract
OpFinishHandleBaseintoinclude/condy/finish_handle_base.hppand adjustruntime.hpp/finish_handles.hppincludes accordingly. - Update
HandleLikeand all affected finish handles to usecancel(Runtime*), withOpFinishHandle::cancel()delegating toRuntime::cancel(). - Simplify many tests by replacing manual ring/event loops with
condy::sync_wait.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
include/condy/runtime.hpp |
Stops including finish_handles.hpp; uses finish_handle_base.hpp while keeping cancel processing in the runtime event loop. |
include/condy/finish_handles.hpp |
Moves cancellation to cancel(Runtime*), uses Runtime::cancel() for OpFinishHandle, and passes runtime through parallel finish handles. |
include/condy/finish_handle_base.hpp |
New home for OpFinishHandleBase used by the runtime to dispatch CQEs. |
include/condy/concepts.hpp |
Updates HandleLike to require cancel(Runtime*). |
include/condy/channel.hpp |
Updates channel finish handles to accept Runtime* in cancel. |
include/condy/channel_legacy.hpp |
Updates legacy channel finish handles to accept Runtime* in cancel. |
tests/test_parallel_finish_handle.cpp |
Adapts test-only finish handle to cancel(Runtime*) and updates call sites. |
tests/test_parallel_awaiter.cpp |
Adapts test-only finish handle to cancel(Runtime*) and adds runtime include. |
tests/test_op_finish_handle.cpp |
Removes a cancellation test that depended on the previous “cancel via Context ring” behavior. |
tests/test_op_awaiter.cpp |
Replaces manual event loop wiring with sync_wait and adjusts/selects new test coverage. |
tests/test_awaiter_operations.cpp |
Replaces manual event loop wiring with sync_wait. |
Comments suppressed due to low confidence (1)
include/condy/channel_legacy.hpp:428
cancel(Runtime* runtime)only usesruntimein anassert. InNDEBUGbuilds the parameter becomes unused, and the repo builds with-Wall -Wextra -Werror(CMakeLists.txt:59), so this can fail compilation due to-Wunused-parameter. Mark the parameter[[maybe_unused]](like the PushFinishHandle version) or otherwise reference it outside the assert.
void cancel(Runtime *runtime) noexcept {
assert(runtime == runtime_);
if (channel_->cancel_pop_(this)) {
// Successfully canceled
runtime_->resume_work();
runtime_->schedule(this);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
169821a to
c2aa4ee
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8d64f73 to
3063349
Compare
No description provided.