rmannibucau opened a new pull request, #9401:
URL: https://github.com/apache/hop/pull/9401

   Fixes #9399
   
   Split out of #9374 per review: the engine-side stop/completion deadlock and 
reentrant-stopping fix, isolated from the transform-lifecycle changes (now 
#<pending>).
   
   ## Problem
   The local pipeline shutdown monitor can deadlock. A JVM thread dump of a 
pipeline shutdown showed a three-thread cycle:
   - TableInput completion holds the transform monitor and waits for the 
pipeline monitor in the transform-finished listener.
   - FilterRows completion holds the pipeline monitor and waits for the 
transforms-list monitor in `transforms.size()`.
   - ExecSqlRow error shutdown holds the transforms-list monitor in `stopAll()` 
and waits for the TableInput monitor in `stopRunning()`.
   
   ## What changed
   - Iterate snapshots of the transform list in `stopAll()`, `safeStop()` and 
`killAllNoWait()` instead of invoking transform callbacks under the 
synchronized list monitor.
   - Atomically claim `stopAll()` before running callbacks, preventing 
duplicate concurrent shutdown and recursive stopping.
   - Update terminal state in `BaseTransform.markStop()` under its monitor, 
then invoke finished listeners outside it.
   - Snapshot finished listeners and invoke them without holding the 
listener-list monitor.
   - Move error-triggered stopping outside the pipeline monitor in the 
completion listener.
   - `stopAll()` sets the terminal stopped/paused/preparing/initializing state 
and fires the stopped listeners in a `finally`, so a throwing stop callback can 
no longer leave the pipeline without a terminal state.
   
   ## Tests
   - `PipelineTest` / `BaseTransformTest` cover stop callback reentrancy, 
concurrent stop-all, snapshot iteration without holding the list monitor, and 
terminal-state reachability when a stop callback throws. 24 `PipelineTest` 
tests pass.


-- 
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