-
-
Notifications
You must be signed in to change notification settings - Fork 109
fix(network): fallback peer lookup for Put response routing #2282
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
|
@claude Please do a skeptical review of this PR |
|
Claude finished @sanity's task in 1m 53s —— View job Skeptical Code ReviewTasks
AnalysisI've conducted a thorough review of this PR. Here are my findings:
|
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 fixes a bug where Put/Get operation responses were silently dropped when the upstream connection was closed before the response could be routed back. The fix adds a fallback peer lookup mechanism and adjusts logging to reflect that dropped connections are a legitimate occurrence rather than an error condition.
Key Changes:
- Adds fallback to
connection_manager.get_peer_location_by_addr()whenpeek_target_peerreturns None for Put/Get operations - Changes log level from error to warn since connection drops can legitimately occur with transient connections
- Improves log message and comments to explain when and why this fallback is needed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| active_connections = ctx.connections.len(), | ||
| phase = "error", | ||
| "Cannot establish connection - no peer info available in operation state" | ||
| phase = "warn", |
Copilot
AI
Dec 13, 2025
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.
The phase field should describe the operational stage, not the log level. Based on the context and similar logging at line 505, this should be phase = "connect" since the code is attempting to establish a connection. Other phase values in this file include "send", "connect", "error", "timeout", "abort", etc., but never a log level like "warn".
| phase = "warn", | |
| phase = "connect", |
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.
Good catch - fixed in 5e234cf. Changed phase = "warn" to phase = "connect" to correctly describe the operational stage.
[AI-assisted - Claude]
When a connection is dropped before a Put response can be routed back, peek_target_peer returns None (since Put operations only store addresses, not full peer info). This caused responses to be silently dropped. Add fallback lookup in connection_manager.get_peer_location_by_addr() when peek_target_peer returns None. Also change log level from error to warn since this can happen legitimately with transient connections. Fixes #2279 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3219dfb to
5e234cf
Compare
Response to Skeptical ReviewThanks for the thorough analysis. You've raised several valid points that I've addressed: ✅ Fixed: Misleading comments about "dropped connections"You correctly identified that the fallback lookup in
NOT when:
Updated comments in 5e234cf to clarify this distinction. ✅ Fixed:
|
|
@claude after all last changes, have been the PR review issues been addressed successfully? |
|
Claude finished @iduartgomez's task in 1m 12s —— View job PR Review Issues - AssessmentTasks
Assessment:
|
Summary
connection_manager.get_peer_location_by_addr()whenpeek_target_peerreturns None for Put/Get operationsRoot Cause
peek_target_peerreturnsNonefor all non-Connect operations (op_state_manager.rs:510-521) because Put/Get operations only store upstream addresses, not fullPeerKeyLocationinfo. When routing responses, this caused the code to fail even when the connection still existed.The fix adds a fallback lookup in
connection_managerby address. This works when:Test plan
test_put_contractpassestest_put_contract_three_hop_returns_responsepassesFixes #2279
🤖 Generated with Claude Code
[AI-assisted - Claude]