[TENT] Add best-effort RDMA task cancellation#2851
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces best-effort task cancellation for queued and RDMA tasks across the Transfer Engine, implementing cancellation APIs in the C++, C, and Python interfaces, and updating the admission queue, RDMA transport, and worker threads. The review highlights several important issues: a data race on non-atomic volatile int fields (success_slices and resolved_slices) in RdmaTask that should be atomic; a potential null-pointer dereference of worker_context_ in Workers::cancel if called after shutdown; the incorrect use of CHECK_POINTER on the non-pointer batch_id in the C API; and a missing null check for slice->task in cancelUnpostedSlice.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Addressed the Gemini cancellation review issues in
Validation:
|
|
Merged the latest Post-merge validation on the H20/RDMA cluster:
GitHub CI has been retriggered for the merge commit. |
Summary
Add task-level, best-effort cancellation to TENT, with the first transport implementation for RDMA.
ibv_post_sendtransferred_bytes, prevent failover after cancellation, and make repeated cancellation idempotentThis is a lifecycle follow-up to #2132. It does not change staging cancellation or add cancellation support to non-RDMA transports.
Semantics
cancelTransfer(batch_id, task_id)returning OK means the request was accepted, not that the task is already terminal. Callers continue polling before freeing the batch.CANCELED, never dispatchedCANCELEDCANCELED, with completed bytes retainedCOMPLETEDNotImplementedValidation
admission_queue_test,tent_runtime_queue_dispatch_test, andrdma_cancel_test: passCANCELEDCompatibility
Default behavior is unchanged unless a caller invokes the new cancellation API. The base
Transportimplementation reportsNotImplemented, so transports opt in explicitly.AI assistance
This change was developed with AI assistance. The implementation, edge-case semantics, tests, sanitizer results, and real-RDMA behavior were reviewed and validated by the submitter.