Repository navigation
feat(execution): add ResumeRun to replay output after a dropped stream - #3
Merged
Merged
Conversation
When a Run stream dropped, clients could only read the final status with GetExecution; output produced after the drop was lost. ResumeRun reattaches to a run owned by the caller: the server replays buffered events with seq greater than after_seq and then continues with live events until Finished. - RunEvent.ReplayGap is sent first when part of the requested range was evicted from the per-run buffer (1 MiB, kept 5 minutes after the run finishes). - ErrorDetail.REASON_REPLAY_UNAVAILABLE reports that nothing is buffered any more. - ExecutionInternalService gains the matching RPC with a CallContext. The change is backwards compatible with 0.3.0. The npm package version is 0.4.0.
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
When the Run stream drops (mobile networks, gateway restarts, several gateway instances), the client can currently only read the final status with
GetExecution, so output produced after the drop is lost. This addsExecutionService.ResumeRun, which replays buffered events and then continues live.Design
ResumeRun(execution_id, after_seq)is a server stream. It replays events withseq > after_seqfrom a per-run buffer and then follows the live run untilFinished. Clients de-duplicate byseq.RunEvent.ReplayGap{first_available_seq}opens the stream when part of the range was evicted.FAILED_PRECONDITIONandErrorDetail.REASON_REPLAY_UNAVAILABLE.playground.svc.v1.ExecutionInternalService.ResumeRuncarries the gateway'sCallContext.RPC_DESIGN.mdandSECURITY_PROTOCOL.mdare updated. The version is 0.4.0.Testing
buf lintpasses, andbuf breaking --against mainreports no breaking change.go test ./...passes, including new validation cases: a valid resume request, and an execution id with path characters that is rejected.Not verified