Repository navigation
fix(amber): emit ExecutionStateUpdate after resume - #4515
Closed
Yicong-Huang wants to merge 1 commit into
Closed
Yicong-Huang wants to merge 1 commit into
Yicong-Huang wants to merge 1 commit into
Conversation
ResumeHandler.resumeWorkflow finished by sending ExecutionStatsUpdate and RuntimeStatisticsPersist to the client but never sent ExecutionStateUpdate. PauseHandler emits the corresponding state event at the end of pause, so the asymmetry meant clients (and tests) had no event-driven signal for the resume → RUNNING transition; consumers had to fall back to Thread.sleep or rely on stats events. The aggregated state is already correct on the server side after the per-worker resume futures resolve, so the fix is just to broadcast it. Closes apache#4514
Yicong-Huang
added a commit
to Yicong-Huang/texera
that referenced
this pull request
Apr 26, 2026
Once apache#4515 (ResumeHandler emits ExecutionStateUpdate) lands, the post-resume Thread.sleep(400) in PauseSpec.shouldPause can be replaced with stateReached(client, RUNNING). The test verifies pause/resume mechanics; it does not need to ensure tuple-level progress between the two pause-resume cycles, so a state-based wait is sufficient. Marks this PR as dependent on apache#4515.
Contributor
Author
|
Closing — the test motivation for this change can be solved without a new event broadcast: |
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.
What changes were proposed in this PR?
ResumeHandler.resumeWorkflow(ResumeHandler.scala) finished by sendingExecutionStatsUpdateandRuntimeStatisticsPersistto the client but never sentExecutionStateUpdate.PauseHandler.scala:88-90emits the corresponding state event at the end of pause, so the asymmetry meant clients (and tests) had no event-driven signal for the resume → RUNNING transition.The aggregated state is already correct on the server side after the per-worker resume futures resolve (each
workerInterface.resumeWorker(...)returns aWorkerStateResponseandResumeHandlerupdates the internalWorkerExecutionstate with that result, socp.workflowExecution.getStatereturnsRUNNING). The fix is to broadcast it:sendToClient(ExecutionStatsUpdate(stats)) sendToClient(RuntimeStatisticsPersist(stats)) +sendToClient(ExecutionStateUpdate(cp.workflowExecution.getState))Any related issues, documentation, discussions?
Closes #4514
How was this PR tested?
sbt WorkflowExecutionService/compilesucceeds;scalafmtCheckAllclean. The two existing consumers ofExecutionStateUpdate(ExecutionStatsService.scala:209andExecutionConsoleService.scala:204) already handleWorkflowAggregatedState.Recognized, so an additionalRUNNINGemit at resume time is a strictly additive event. No existing test asserts the absence of this event. Relying on CI for the full backend test run.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.7)