csurong opened a new pull request, #18736:
URL: https://github.com/apache/dolphinscheduler/pull/18736

   ## Was this PR generated or assisted by AI?
   
   YES. AI assisted with the investigation, implementation, tests, review, and 
this description.
   
   ## Purpose of the pull request
   
   Fixes #18735.
   
   If a terminal ACK is lost, the workflow can finish and leave the Master's 
cache before the executor retries its report. The retry then fails because the 
listener can no longer find the workflow. The result is already in the 
database, but the executor keeps waiting for an ACK and cannot finish cleaning 
up.
   
   This change lets the Master confirm that persisted result and resend the ACK 
after cache eviction, so the executor can follow its normal finalization path.
   
   ## Brief change log
   
   - On a terminal report with no cached workflow, check the persisted task, 
workflow, executor host, and terminal state before sending the ACK. This path 
does not update task state or replay workflow events.
   - Accept the state changes that can happen after the original report: a 
failed task waiting for retry can be paused or killed, and a failed or killed 
task can be forced to success. Unrelated or unfinished states are still 
rejected.
   - Allow the executor client to send an ACK from a persisted TaskInstance. 
Keep success alerts before the ACK, as in the existing handler.
   - Add listener/client tests and three Spring integration cases covering a 
lost SUCCESS ACK and a lost FAILED ACK followed by pause or stop. Each 
integration case waits for cache eviction before restoring ACK delivery, then 
checks that the executor resources are released.
   
   ## Verify this pull request
   
   The Maven reactor build passed with 68 selected test cases, including the 
three Spring/H2 integration cases:
   
   ```sh
   mvn -B -ntp -pl dolphinscheduler-master -am \
     
-Dtest=TaskExecutorEventListenerImplTest,TaskExecutorClientTest,TaskSuccessPersistenceRecoveryTest,TaskSuccessLifecycleEventHandlerTest,TaskTerminalAckRecoveryTestCase
 \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -Djacoco.skip=true -Dspotless.skip=true \
     -Dmaster.server-load-protection.enabled=false test
   ```
   
   The first run hit the local machine's load-protection threshold, which 
prevented workflow commands from being consumed. The command above disables 
that check for the test process; no repository configuration was changed. These 
are targeted tests, not the full test suite. The integration cases use logic 
executors and do not exercise physical Worker directory deletion.
   
   `./mvnw -pl dolphinscheduler-master spotless:apply`, the standard 
`spotless:check`, and `git diff --check` also passed.
   
   ## Pull Request Notice
   
   [Pull Request 
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
   


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