feat(rdmacm): add wrapper for rdma_migrate_id#115
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to migrate an Identifier to a different EventChannel by wrapping the identifier's event channel in a Mutex and implementing the migrate method using rdma_migrate_id. It also adds corresponding error types, a test helper wait_for_cm_event, and unit tests. However, a critical lifetime and memory safety issue was identified: migrating an identifier can lead to a use-after-free or undefined behavior if there are unacknowledged events from the old event channel, as Event does not currently keep its source EventChannel alive. It is recommended to update the Event struct to hold an Arc<EventChannel> to prevent this.
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❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a safe Rust wrapper around rdma_migrate_id(3) in the rdmacm communication manager layer, enabling an Identifier (rdma_cm_id) to be migrated to a different EventChannel while keeping the underlying channel alive across migrations.
Changes:
- Introduced
Identifier::migrateplusMigrateError/MigrateErrorKindto wraprdma_migrate_id. - Updated
Identifierto hold its currentEventChannelin aMutex<Arc<EventChannel>>to keep lifetimes correct across migrations and serialize concurrent migrations. - Added/updated tests with a small polling-based helper (
wait_for_cm_event) and new test coverage for event delivery after migration.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Luke Yue <lukedyue@gmail.com>
01a1234 to
74c475a
Compare
For #112