Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

branch-3.0: [Chore](Job)Add scheduling logs for periodic jobs. #44843 #45070

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public void run(Timeout timeout) {
log.warn("dispatch timer job failed, queue maybe full. job id is {}, job name is {}",
this.job.getJobId(), this.job.getJobName() + getMsgWhenExecuteQueueFull());
}
log.info("dispatch timer job success, job id is {}, job name is {}", this.job.getJobId(),
this.job.getJobName());
} catch (Exception e) {
log.warn("dispatch timer job error, task id is {}", this.job.getJobId(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ public void close() throws IOException {
private void cycleTimerJobScheduler(T job, long startTimeWindowMs) {
List<Long> delaySeconds = job.getJobConfig().getTriggerDelayTimes(System.currentTimeMillis(),
startTimeWindowMs, latestBatchSchedulerTimerTaskTimeMs);
if (CollectionUtils.isEmpty(delaySeconds)) {
log.info("skip job {} scheduler timer job, delay seconds is empty", job.getJobName());
return;
}
log.info("job {} scheduler timer job, delay seconds size is {}", job.getJobName(), delaySeconds.size());
if (CollectionUtils.isNotEmpty(delaySeconds)) {
delaySeconds.forEach(delaySecond -> {
TimerJobSchedulerTask<T> timerJobSchedulerTask = new TimerJobSchedulerTask<>(timerJobDisruptor, job);
Expand Down Expand Up @@ -186,6 +191,8 @@ private void executeTimerJobIdsWithinLastTenMinutesWindow() {
this.latestBatchSchedulerTimerTaskTimeMs = System.currentTimeMillis();
}
this.latestBatchSchedulerTimerTaskTimeMs += BATCH_SCHEDULER_INTERVAL_MILLI_SECONDS;
log.info("execute timer job ids within last ten minutes window, last time window is {}",
TimeUtils.longToTimeString(lastTimeWindowMs));
if (jobMap.isEmpty()) {
return;
}
Expand All @@ -207,6 +214,7 @@ private void clearEndJob(T job) {
}
try {
Env.getCurrentEnv().getJobManager().unregisterJob(job.getJobId());
log.info("clear finish job, job id is {}, job name is {}", job.getJobId(), job.getJobName());
} catch (JobException e) {
log.error("clear finish job error, job id is {}", job.getJobId(), e);
}
Expand Down
Loading