feat: basic envoy tunnel impl#4534
feat: basic envoy tunnel impl#4534MasterPtato wants to merge 1 commit into03-27-chore_envoy_clientfrom
Conversation
|
🚅 Deployed to the rivet-pr-4534 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
PR Review: feat: basic envoy tunnel impl (#4534) NOTE: This is a draft PR. Feedback is provided for early review purposes. CRITICAL BUGS
JavaScript compares objects by reference, not value. Using array tuples as Map keys means map.get([a, b]) will never find an entry stored with map.set([a, b], ...) because each literal [a, b] is a distinct object. Affected: ctx.pendingRequests.get([msg.messageId.gatewayId, msg.messageId.requestId]) in actor.ts and ctx.requestToActor.get([...]) in tunnel.ts. Both lookups will always return undefined. Fix: use a composite string key, e.g. convert each ID to hex and join them.
The code checks ctx.protocolMetadata?.maxPayloadSize but the protocol field is maxResponsePayloadSize. This comparison is always against undefined, so the payload size limit is silently bypassed.
handleRequestStart forwards the message to the actor but never inserts into ctx.requestToActor. The map remains empty, so handleRequestChunk and handleRequestAbort can never route chunks to the correct actor.
sendResponse is async but is not awaited in the actor-not-found 503 path. Errors are silently dropped. MODERATE ISSUES
Both streaming and non-streaming paths call spawn(async () => ...) without any .catch() or try/catch. If fetch or sendResponse throws, the error is silently swallowed and the client hangs waiting for a response that never arrives.
CLAUDE.md says not to modify an existing published *.bare protocol version. This PR adds maxResponsePayloadSize: u64 to ProtocolMetadata in v1.bare. If this schema is already deployed, this is a breaking wire-format change and needs a new versioned schema instead.
name: config.poolName was silently dropped from the ToRivetInit message. If the engine still reads this field for pool identification, this is a silent breakage that should be documented. MINOR ISSUES
POSITIVE CHANGES
|
056dbbc to
ecb7a20
Compare
748e9f1 to
9adad6e
Compare
ecb7a20 to
58851a4
Compare
9adad6e to
14e5bc7
Compare
14e5bc7 to
d705065
Compare
58851a4 to
68bbabd
Compare
68bbabd to
5c9a464
Compare
d705065 to
da489fa
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: