zhangshenghang opened a new pull request, #13336:
URL: https://github.com/apache/seatunnel/pull/13336

   Yes.
   
   ## Purpose of the change
   
   Fixes #13314
   
   `PhysicalVertex.resetExecutionState` swallowed IMap write failures (after 
retries) but still set the in-memory state to `CREATED`. Because every 
transition is validated against the **IMap** state (`updateTaskState` reads it 
back), the restored pipeline then tried to deploy a vertex whose `DEPLOYING` 
transition was rejected by the terminal-state guard ("Task is trying to leave 
terminal state FAILED"). The vertex never left CREATED, 
`areAllVerticesRunningOrFinished` never became true, and no terminal callback 
could ever arrive — the pipeline hung at DEPLOYING forever (until the next 
master failover), silently.
   
   ## Brief change log
   
   - `PhysicalVertex.resetExecutionState`: when the IMap write of the reset 
fails after retries, the in-memory state now **keeps the terminal state** 
(aligned with the IMap) instead of moving to CREATED.
   - `PhysicalVertex.hasTerminalResult()` (package-private): whether a terminal 
result for the current attempt already arrived; used to distinguish a stuck 
vertex from one whose failure propagates through the regular callback path.
   - `SubPlan.stateProcess` DEPLOYING pass: after deploying, vertices that can 
never make progress — still CREATED after their deployment was attempted, or 
FAILED/CANCELED with no terminal result for the current attempt — now fail the 
pipeline explicitly (`makePipelineFailing`), so the bounded restore path 
retries instead of waiting at DEPLOYING forever. Vertices whose terminal result 
already arrived are excluded to avoid double-reporting deploy failures.
   
   ## Verifying this change
   
   - `PhysicalVertexTest`:
     - `shouldKeepTerminalStateWhenResetCannotBePersisted`: with a failing IMap 
write, reset keeps the terminal state;
     - `shouldResetToCreatedWhenResetCanBePersisted`: control — a persisted 
reset still moves to CREATED.
   - `SubPlanTest`:
     - `shouldFailThePipelineWhenAVertexNeverLeavesItsTerminalState` and 
`shouldFailThePipelineWhenADeployedVertexStaysCreated`: both stuck shapes fail 
the pipeline (FAILING);
     - `shouldNotFailThePipelineForVerticesWhoseTerminalResultArrived`: a 
failed vertex whose callback already resolved is left to the regular callback 
path (stays DEPLOYING);
     - `shouldReachRunningWhenEveryVertexWasDeployed`: control — healthy 
deployment still reaches RUNNING.
   
   Verified with:
   
   ```
   ./mvnw -pl seatunnel-engine/seatunnel-engine-server test 
-Dtest='SubPlanTest,PhysicalVertexTest'
   ```
   
   I verified the fix locally.
   


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