NIFI-16088 Add scheduling diagnostics for cron primary-node-only processors#11407
Open
kevdoran wants to merge 1 commit into
Open
NIFI-16088 Add scheduling diagnostics for cron primary-node-only processors#11407kevdoran wants to merge 1 commit into
kevdoran wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 staysRUNNINGbut 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
CronSchedulingAgentTestasserting 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:checkclean for the module.