VuMartin opened a new pull request, #7914:
URL: https://github.com/apache/texera/pull/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)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to