fix(WorkflowExecutionService, v1.2): shutdown console writer thread on unsubscribe - #8063
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
…bscribe (#7914) ### What changes were proposed in this PR? Fixes a console writer thread leak in `ExecutionConsoleService`. The console writer executor was not being shut down when an execution service was unsubscribed. This could leave `texera-console-writer` threads alive after workflow execution finished. Before: <img width="1240" height="60" alt="Screenshot 2026-08-23 at 11 40 04 PM" src="https://github.com/user-attachments/assets/d199f3c0-a463-4645-addf-a5dc2ee456d8" /> After: <img width="1348" height="48" alt="Screenshot 2026-08-23 at 6 40 25 PM" src="https://github.com/user-attachments/assets/a2e0c9bc-607f-451f-bccb-ec4ea4315a96" /> <img width="1348" height="60" alt="Screenshot 2026-08-23 at 6 41 53 PM" src="https://github.com/user-attachments/assets/3d7742ef-db7a-4790-a43d-d8b5bfa69d58" /> <img width="1348" height="60" alt="Screenshot 2026-08-23 at 6 42 18 PM" src="https://github.com/user-attachments/assets/c2e7a6d6-e516-4dd1-8ed9-7d6cccf22f1f" /> <img width="1348" height="60" alt="Screenshot 2026-08-23 at 6 42 42 PM" src="https://github.com/user-attachments/assets/084bed9e-1338-4e27-9563-ad22708d75aa" /> <img width="1348" height="60" alt="Screenshot 2026-08-23 at 6 42 55 PM" src="https://github.com/user-attachments/assets/ee11bcca-35fa-453e-91e2-8f3e06065c1d" /> This PR: - Shuts down the console writer executor during `unsubscribeAll()`. - Waits for termination and falls back to `shutdownNow()` if necessary. - Closes active console message writers and clears the writer map. - Adds a test verifying the console writer executor is shut down and terminated. ### Any related issues, documentation, discussions? Fixes #7455 ### How was this PR tested? Ran: ```bash sbt "project WorkflowExecutionService" "testOnly *ExecutionConsoleServiceSpec -- -z unsubscribeAll" ``` Manual testing: Ran workflows multiple times and checked the console writer threads with: ```bash jcmd 57436 Thread.print | grep "texera-console-writer" ``` ```bash jcmd 67548 Thread.print | grep "texera-console-writer" ``` Verified that the console writer threads are terminated after workflow execution completes and unsubscribeAll() is called. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: ChatGPT (5.5 mini) (backported from commit bdc6d2a)
Contributor
Author
|
The cherry-pick conflicted and was committed with conflict markers. Resolve the conflicts on this branch, then mark this PR ready for review. Conflicting files:
|
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?
Automated backport of #7914 to
release/v1.2.Source: bdc6d2a · automation run
Any related issues, documentation, discussions?
Backport of #7914. Originally linked #7455.
How was this PR tested?
Release-branch CI runs on this branch once the conflicts are resolved and this PR is marked ready for review.
Was this PR authored or co-authored using generative AI tooling?
No.