fix(iroh): bound retry and lookup lifecycles - #1
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughA CancellationToken is threaded through the address-resolution path: Socket creates and passes it via ActorMessage::ResolveRemote into RemoteMap and RemoteStateActor, which now tracks cancellations, prunes cancelled queued resolves in RemotePathState, and bounds/deduplicates pending open-path retries. Tests validate drop-triggered cancellation and queue behavior. ChangesCancellable resolve_remote propagation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Socket
participant RemoteMap
participant RemoteStateActor
participant RemotePathState
Socket->>Socket: create CancellationToken + drop_guard
Socket->>RemoteMap: resolve_remote(addr, tx, cancellation)
RemoteMap->>RemoteStateActor: ResolveRemote(addrs, tx, cancellation)
RemoteStateActor->>RemotePathState: resolve_remote(tx, cancellation)
RemotePathState-->>RemoteStateActor: queued = true/false
RemoteStateActor->>RemoteStateActor: register cancellation.cancelled_owned()
alt caller drops request
Socket->>Socket: drop_guard triggers cancellation
RemoteStateActor->>RemoteStateActor: cancellation future resolves
RemoteStateActor->>RemotePathState: prune_cancelled_resolve_requests()
RemoteStateActor->>RemoteStateActor: stop address-lookup stream if empty
else resolution completes
RemotePathState->>RemoteStateActor: emit_pending_resolve_requests()
RemoteStateActor->>RemoteMap: reply via oneshot
end
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Description
Hardens two per-peer actor lifecycles in the cmux Iroh v1.0 fork.
Both fixes use red-test then green-fix commit pairs.
Breaking Changes
None.
Residual risk
Persistent path-ID exhaustion can still produce bounded retry CPU. The cancellation path is scoped to address resolution and does not alter established connection lifetime.
Verification
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
Tests