Mrhs121 commented on code in PR #18694:
URL: 
https://github.com/apache/dolphinscheduler/pull/18694#discussion_r4245860612


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/LogicTaskExecutor.java:
##########
@@ -66,6 +75,7 @@ public void pause() {
         // if the status is initialized, then we can directly change to paused
         if (logicTask != null) {
             logicTask.pause();
+            resetStateTrackTime();

Review Comment:
   Nice idea,  makes sense. I’d adjust the implementation as follows:
   * Keep framework-level state polling at a fixed 10-second interval
   *  Move the checkInterval handling into DependentLogicTask. The first check 
would query dependencies immediately; subsequent checks would return the cached 
status until the configured interval has elapsed. For example, with 
checkInterval = 20s, the check at 10s would return the cached status, and the 
check at 20s would query dependencies again
   *  Check for paused, killed, or completed states before applying the query 
interval. This allows pause/kill to be reported on the next framework poll 
without waiting for checkInterval, so the extra one-time state-check request 
can be removed
   *  Keep the concurrency protection: use short synchronized blocks for state 
access, leave the dependency query outside the lock, and apply its result only 
if the task is still running. This prevents a query from overwriting a 
concurrent pause/kill state without making the control operation wait for the 
query
   
   Does this approach look good to you?



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