-
-
Notifications
You must be signed in to change notification settings - Fork 107
fix: prevent duplicate gateway dials and route host results #2110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses issues with duplicate gateway connections during bootstrap and improves the routing of operation results to the session actor system.
Key Changes:
- Added duplicate peer detection in
ConnectionManager.should_accept()to prevent reservation leaks when the same peer is processed multiple times - Implemented in-flight gateway tracking during bootstrap to prevent parallel duplicate connection attempts
- Refactored host result creation to occur in the network layer before being routed to
MessageProcessor, ensuring proper error handling and result delivery
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/core/src/ring/connection_manager.rs |
Added early duplicate peer check, helper methods get_reserved_connections() and has_known_peer(), and test coverage for reservation leak prevention |
crates/core/src/operations/put.rs |
Updated subscription requests to use start_subscription_request_internal with track_parent=false to avoid unnecessary parent tracking edges |
crates/core/src/operations/mod.rs |
Introduced start_subscription_request_internal to allow callers to opt out of parent tracking when spawning subscription operations |
crates/core/src/operations/connect.rs |
Added duplicate peer check in join_ring_request and in-flight gateway tracking in initial_join_procedure to prevent concurrent duplicate dials |
crates/core/src/node/mod.rs |
Refactored process_message_decoupled to build host results before calling MessageProcessor and cleaned up executor callback parameter threading |
crates/core/src/node/message_processor.rs |
Updated handle_network_result to accept HostResult instead of OpEnum, simplifying the interface and improving separation of concerns |
crates/core/src/contract/handler.rs |
Added debug logging for transaction registration and warnings when session adapter is not installed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
the op results look good but they are mixed with the changes to avoid more than one concurrent gateway connection op at the same time (which seem odd) |
|
@iduartgomez good call. The extra check was serialising the bootstrap loop whenever we already had a reservation, which wasn’t necessary. I’ve removed that guard so we keep dialing distinct gateways in parallel while still deduping per-peer using the in-flight map plus the connection manager’s duplicate check. CI is green again. |
d2ef481 to
ce9714e
Compare
Problem
This Solution
Testing