fix: emit terminal event for operation failures - #1007
Merged
Conversation
Greptile SummaryThe PR terminalizes failed cluster-operation chains with one current-run
Confidence Score: 5/5The PR appears safe to merge with operation failures now producing the terminal event required by result consumers while preserving shutdown behavior. Current-run boundaries exclude historical terminal records, synchronous message delivery reaches the pre-registered shutdown subscriber, and the updated tests cover both validation-failure paths.
|
| Filename | Overview |
|---|---|
| src/orchestrator.js | Adds current-run terminal-event guarding and routes operation failures through the established terminal shutdown subscription without an accepted defect. |
| tests/integration/orchestrator-flow.test.js | Extends both operation-validation failure scenarios with exact-one CLUSTER_FAILED assertions. |
Sequence Diagram
sequenceDiagram
participant Op as CLUSTER_OPERATIONS handler
participant Bus as MessageBus / Ledger
participant Terminal as CLUSTER_FAILED subscription
participant Cluster as Orchestrator.stop
Op->>Op: Operation chain rejects
Op->>Bus: Publish CLUSTER_OPERATIONS_FAILED
Op->>Bus: Query current-run terminal events
alt No terminal event exists
Op->>Bus: Publish CLUSTER_FAILED
Bus->>Terminal: Deliver terminal event synchronously
Terminal->>Cluster: stop(clusterId)
else Current run already terminal
Op-->>Op: Suppress duplicate terminal event
end
Reviews (1): Last reviewed commit: "fix: emit terminal event for operation f..." | Re-trigger Greptile
|
🎉 This PR is included in version 6.39.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Root cause
CLUSTER_OPERATIONS failures emitted only the nonterminal CLUSTER_OPERATIONS_FAILED diagnostic before stopping directly. Foreground result writers therefore saw no authoritative terminal event and rejected the retained result.
Validation