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

   Yes.
   
   ## Purpose of the change
   
   Fixes #13315 (first half of the suggested fix)
   
   `NotifyTaskRestoreOperation` reported a failed `restoreState` with a 
**single fire-and-forget** `CheckpointErrorReportOperation` (no join, no 
retry), while the master-side `restoreTaskState` only joins the *delivery* of 
the restore operation. If the report was lost (invocation failure during a 
partition or master switchover), the task spun in `WAITING_RESTORE` forever and 
nothing timed that phase out — the pipeline stayed RUNNING with no progress and 
no error. Terminal task-status reports already retry indefinitely 
(`TaskExecutionService.notifyTaskStatusToMaster`, including a dedicated 
`JobRestoreInProgressException` retry path), so the two reporting channels had 
deliberately different reliability, and the restore phase used the unreliable 
one.
   
   ## Brief change log
   
   - `NotifyTaskRestoreOperation`: the failed-restore report now goes through 
`reportRestoreErrorWithRetry`, which retries until the master accepts the 
report (a restoring master answers `JobRestoreInProgressException` until it 
finished restoring) or the worker's task execution service stops, mirroring 
`notifyTaskStatusToMaster`. Interrupting the reporting thread stops the loop 
and restores the interrupt flag.
   - `TaskExecutionService.isRunning()` (public accessor): lets worker-side 
retry loops give up during shutdown.
   
   The second half of the issue (a timeout for the WAITING_RESTORE phase on the 
master) is intentionally left out of this change to keep it minimal; this 
closes the delivery-loss trigger of the hang.
   
   ## Verifying this change
   
   New focused `NotifyTaskRestoreOperationTest` (no existing test class covered 
this operation):
   
   - `shouldRetryUntilTheServiceStops`: a failing delivery is retried while the 
service runs and the loop gives up once it stops;
   - `shouldNotReportWhenTheServiceAlreadyStopped`: a stopped service reports 
nothing.
   
   Verified with:
   
   ```
   ./mvnw -pl seatunnel-engine/seatunnel-engine-server test 
-Dtest=NotifyTaskRestoreOperationTest
   ```
   
   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