re20052 commented on code in PR #66173:
URL: https://github.com/apache/doris/pull/66173#discussion_r3710565762


##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java:
##########
@@ -1943,8 +1945,14 @@ public boolean isExpired() {
         if (!isFinal()) {
             return false;
         }
-        Preconditions.checkState(endTimestamp != -1, endTimestamp);
-        return (System.currentTimeMillis() - endTimestamp) > 
Config.label_keep_max_second * 1000;
+        try {
+            Preconditions.checkState(endTimestamp != -1, endTimestamp);
+            return (System.currentTimeMillis() - endTimestamp) > 
Config.label_keep_max_second * 1000;
+        } catch (Exception e) {
+            LOG.warn("routine load job {} is in final state {} but has no 
endTimestamp. Force to expire it.",
+                    id, state, e);
+            return true;

Review Comment:
   Fixed by returning false instead of true when a final job has no 
endTimestamp. This avoids removing a job that races with an in-progress 
cancel/stop (state set before endTimestamp); it'll be re-evaluated next cleanup 
round once endTimestamp is published. Still avoids throwing, so cleanup isn't 
broken.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to