🚧 RPC: Add action field to GetObject for error recovery 🚧#6837
Draft
knutwannheden wants to merge 3 commits intomainfrom
Draft
🚧 RPC: Add action field to GetObject for error recovery 🚧#6837knutwannheden wants to merge 3 commits intomainfrom
action field to GetObject for error recovery 🚧#6837knutwannheden wants to merge 3 commits intomainfrom
Conversation
Add a nullable `action` field to GetObject requests. When null, the request is a normal data transfer. When set to "revert", the handler restores both remoteObjects and localObjects to the pre-transfer state, and the requester reverts its own remoteObjects tracking to match. This fixes state desynchronization after failed deserialization: the handler stores the pre-transfer baseline in an actionBaseline map at transfer start, optimistically updates remoteObjects when streaming completes, and rolls both maps back on revert. The action field is extensible for future corrective actions (clear, reset, abort) without protocol changes.
action field to GetObject for error recovery
action field to GetObject for error recoveryaction field to GetObject for error recovery 🚧
Resolve conflicts in getObject error handling across Java, TypeScript, and Python RPC implementations. Combined main's baseline fix (using remoteObjects as receive baseline) and Python's END_OF_OBJECT drain logic with the branch's revert-based error recovery.
When an RPC object transfer fails, refs registered in localRefs (sender) and remoteRefs (receiver) during the failed transfer were not cleaned up. On retry, the sender would send ref-ID-only (no payload) but the receiver would throw "reference to object not previously sent". Track newly registered refs during each transfer and remove them from the shared maps on failure. Also fix sender-side failure cleanup: remove from actionBaseline so a subsequent "revert" from the receiver doesn't restore the remoteObjects entry the sender already cleaned up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
actionfield to GetObject requests for receiver-initiated corrective actionsaction="revert", the handler restores bothremoteObjectsandlocalObjectsto the pre-transfer state using a stored baselineremoteObjectstracking to the pre-transfer value to stay in synclocalRefs/remoteRefs) during each transfer and removes them on failure, preventing "reference to object not previously sent" errors on retryactionBaselineso a subsequent "revert" from the receiver doesn't restore theremoteObjectsentry the sender already cleaned upactionfield can carry future actions without protocol changesSee
doc/adr/0009-getobject-action-field.mdfor the full design rationale.Test plan
gw :rewrite-core:test --tests "*RpcTest*"— all tests pass includingsendFailureCleansUpRemoteObjectsgw :rewrite-python:integTest— exercise composite recipe RPC lifecyclegw :rewrite-javascript:test --tests "*Rpc*"— JS RPC testsnpx tsc --noEmit— no errors insrc/)