github-actions[bot] commented on code in PR #66173:
URL: https://github.com/apache/doris/pull/66173#discussion_r3710171342
##########
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:
[P1] Keep cleanup synchronized with final-state publication
`executeStop()` and `executeCancel()` set `state` before `endTimestamp`
while holding only the job lock. `cleanOldRoutineLoadJobs()` runs in the
scheduler under only the manager lock, and `isExpired()` reads both fields
without the job lock. If cleanup lands between those writes (for example,
concurrent with a user STOP or task-scheduler cancellation), this new fallback
returns `true`, removes the job immediately, and can journal REMOVE before the
transition journals CHANGE. That drops the retained reason/history and replay
then sees a state change for an absent job. Read the state/timestamp pair under
the job lock (or publish it atomically), repair truly historical missing
timestamps at deserialization, and add a latch-based race test.
--
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]