Skip to content

[fix] fixed an issue where cron jobs were not rescheduled#4159

Merged
Aias00 merged 2 commits into
apache:masterfrom
Duansg:fix-4157
Jun 18, 2026
Merged

[fix] fixed an issue where cron jobs were not rescheduled#4159
Aias00 merged 2 commits into
apache:masterfrom
Duansg:fix-4157

Conversation

@Duansg

@Duansg Duansg commented Jun 18, 2026

Copy link
Copy Markdown
Member

What's changed?

close #4157

Fixed an issue where monitoring tasks scheduled by cron would revert to fixed-interval scheduling. Due to parameter copying issues in the build paths of some tasks, the TimerDispatcher never entered the cron branch—cron would only function properly after editing the monitor. This issue also occurred during creation, restart, and when the collector reconnected.

Modification details

Copy scheduleType / cronExpression in every path that builds a cyclic job:

  • restart: SchedulerInit.run() .
  • create: MonitorServiceImpl.addMonitor().
  • template update:MonitorServiceImpl.updateAppCollectJob().
  • collector online: CollectorJobScheduler.collectorGoOnline().
  • One-time detection paths (cyclic = false) are left unchanged.
  • The correct execution of the cron job following the above modification path has been verified.

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

@Aias00 Aias00 merged commit c785f60 into apache:master Jun 18, 2026
4 checks passed
@Duansg Duansg deleted the fix-4157 branch June 18, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Cron 表达式定时任务在重启hertzbeat之后失效

2 participants