Skip to content

NIFI-16088 Add scheduling diagnostics for cron primary-node-only processors#11407

Open
kevdoran wants to merge 1 commit into
apache:mainfrom
kevdoran:wi12-cron-reconnect
Open

NIFI-16088 Add scheduling diagnostics for cron primary-node-only processors#11407
kevdoran wants to merge 1 commit into
apache:mainfrom
kevdoran:wi12-cron-reconnect

Conversation

@kevdoran

@kevdoran kevdoran commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Relates to NIFI-16088.

Cron triggers are scheduled as one-shot tasks that reschedule only after a successful run (CronSchedulingAgent). If the triggered task throws, or scheduling the next trigger fails, the scheduling chain silently terminates: the component stays RUNNING but never fires again on its schedule until it is stopped and started — with nothing in the logs, because the exception is discarded by the scheduled executor.

This adds diagnostics only (no scheduling or lifecycle behavior is changed):

  • CronSchedulingAgent: log a WARN (before propagating) when a cron-scheduled trigger throws, or when rescheduling the next trigger fails, noting the component will not run again on its schedule until it is stopped and started.
  • ConnectableTask: log at INFO (was DEBUG) when a cron-driven, Primary-Node-Only component's fire is skipped because the node is not the primary node; timer-driven components stay at DEBUG to avoid noise, since cron fires are comparatively rare.

Motivated by a case where Primary-Node-Only cron processors silently stopped firing after a heartbeat-induced disconnect/reconnect and had to be manually stopped/started; the existing logs gave no signal as to why.

Verification

  • New unit test in CronSchedulingAgentTest asserting a triggered exception still propagates (is not silently swallowed).
  • ./mvnw -pl nifi-framework-bundle/nifi-framework/nifi-framework-core -am test -Dtest=CronSchedulingAgentTest — green (4 tests).
  • checkstyle:check clean for the module.

…essors

Cron triggers are scheduled as one-shot tasks that reschedule only after a
successful run. If the triggered task throws, or the next trigger fails to be
scheduled, the scheduling chain silently terminates: the component stays
RUNNING but never fires again on its schedule until it is stopped and started,
with no record in the logs. Make that observable:

- CronSchedulingAgent: log a WARN (before propagating) when a cron-scheduled
  trigger throws or when rescheduling the next trigger fails, noting the
  component will not fire again until stopped and started.
- ConnectableTask: log at INFO (was DEBUG) when a cron-driven, primary-node-only
  component is skipped because this is not the primary node, so a skipped
  scheduled fire is visible; timer-driven components stay at DEBUG to avoid noise.

Diagnostics only; no scheduling or lifecycle behavior is changed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant