-
Notifications
You must be signed in to change notification settings - Fork 135
chore(pegboard-gateway): remove TunnelAck
#3488
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
base: 11-19-chore_engine-runner_remove_echo_close_on_toclientwebsocketclose
Are you sure you want to change the base?
chore(pegboard-gateway): remove TunnelAck
#3488
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Pull Request Review: Remove
|
972242d to
556b074
Compare
4adef6f to
759df3e
Compare
556b074 to
972242d
Compare
759df3e to
4adef6f
Compare
PR Review: Remove
|
Code Review - PR #3488: Remove
|
PR Review: Remove
|
Pull Request Review: Remove
|
4adef6f to
759df3e
Compare
972242d to
556b074
Compare
Code Review: Remove TunnelAckSummaryThis PR removes the ✅ Positive Observations
|
PR Review: Remove
|
556b074 to
972242d
Compare
759df3e to
4adef6f
Compare
Pull Request Review: Remove
|
Code Review: Remove TunnelAck from ProtocolThis PR removes the TunnelAck mechanism from the runner protocol. I've identified several critical issues that need to be addressed: CRITICAL ISSUE 1: Memory Leak - Pending Messages Never Removed The pending_msgs vector is still being populated (line 179) and checked in GC logic (line 447-451), but the TunnelAck handler that would remove messages is now just a TODO comment (line 228-249). This means:
Recommendation: Either remove pending_msgs entirely OR implement the ToGatewayKeepAlive handler. CRITICAL ISSUE 2: Gateway ID Migration Problem The v2→v3 conversion sets gateway_id to [0; 16] (all zeros), but the code uses this to route messages via GatewayReceiverSubject. A zero UUID likely won't route to a valid gateway. Recommendation: Add validation to reject zero UUIDs, or clarify if v2 clients are still supported. HIGH PRIORITY: Inverted GC Logic? The GC uses <= instead of > for timeout comparison, which seems backwards. It triggers GC when messages are NOT expired rather than when they ARE expired. MEDIUM PRIORITY: TODO Comments POSITIVE:
RECOMMENDATION: Fix critical issues 1 and 2 before merging. The incomplete removal of the ack mechanism will cause memory leaks and incorrect timeout behavior in production. |
972242d to
556b074
Compare
4adef6f to
759df3e
Compare
Pull Request Review: Remove
|
Code Review: Remove
|
759df3e to
4adef6f
Compare
556b074 to
972242d
Compare
PR Review: Remove
|
Code ReviewThis PR simplifies the tunnel message acknowledgement protocol by removing TunnelAck messages. The implementation looks solid overall, but I have identified several areas that need attention. Critical Issues1. Incomplete ToGatewayKeepAlive ImplementationLocation: engine/packages/pegboard-gateway/src/shared_state.rs:227-250 The ToGatewayKeepAlive message handler contains commented-out TODO code. This breaks the acknowledgement mechanism that was previously working. Impact:
Recommendation: Either implement the keep-alive logic fully before merging, OR remove pending_msgs tracking entirely and update the GC logic 2. Potential Logic Error in GC Timeout CheckLocation: engine/packages/pegboard-gateway/src/shared_state.rs:447-452 The comparison operator appears inverted. This will mark messages as not acked when they are UNDER the timeout threshold, not over it. Should trigger timeout when duration >= MESSAGE_ACK_TIMEOUT. Impact: Requests will be killed immediately instead of after 30 seconds. Potential Issues3. Backward Compatibility HandlingLocation: engine/sdks/rust/runner-protocol/src/versioned.rs:1231-1236 and :1331-1336 The v2 to v3 conversion maps deprecated TunnelAck to Abort messages. If a v2 client sends TunnelAck, it will terminate the request unexpectedly. Recommendations:
4. Removed Active Request TrackingLocation: engine/packages/pegboard-runner/src/lib.rs:246-276 (deleted code) The PR removes code that sent close messages to active requests when the runner WebSocket disconnects. Verify this is handled elsewhere. 5. Missing gateway_id in Protocol Version ConversionsLocation: engine/sdks/rust/runner-protocol/src/versioned.rs:178 and :493 When converting v2 messages to v3, the code sets gateway_id to all zeros. If any v2 clients are in use, their tunnel messages won't route correctly. Code Quality ObservationsGood: Protocol Evolution with New ToRunner TypeThe introduction of ToRunner union type is well-designed. This cleanly separates runner-specific messages from client messages. Inconsistent Error HandlingLocation: engine/packages/pegboard-runner/src/tunnel_to_ws_task.rs:54-61 An incomplete TODO in production code path. Should either be implemented or have a tracking issue reference. Index Wrapping Logic Looks CorrectLocation: engine/packages/pegboard-gateway/src/shared_state.rs:354-365 The WebSocket message index wrapping logic with wrapping_gt helper is well-implemented. Performance ImpactReduced Message Overhead: Removing TunnelAck messages cuts message volume by approximately 50% for request/response cycles. This is a significant performance win. Test CoverageMissing Tests:
SummaryOverall Assessment: The core simplification is architecturally sound and will improve performance. However, there are 2 critical blocking issues:
Recommended Next Steps:
Let me know if you need clarification on any of these points! |

No description provided.