The TriggerSchedulerMonitor reports realtime triggers as locked Describe the issue The…
- User
The
TriggerSchedulerMonitorreports realtime triggers as lockedDescribe the issue
The
TriggerSchedulerMonitorreports realtime triggers as locked.[tenant: main] [namespace: company.team] [flow: realtime-kafka] [trigger: kafka] No execution found, schedule is blocked since '2026-04-27T13:38:23.415498Z'
But as those trigger will always be blocked without any executionID they will be reported indefinitly.
Environment
- Kestra Version: develop
Interface
No new interfaces are introduced.
- Assistant
Now let me add a unit test. Check existing scheduler tests for conventions:
- Assistant
Now write the unit test:
- Assistant
The test is running in the background; I'll wait for it to complete.
- Assistant
The diff is minimal and surgical. Now waiting for the test run to finish.
- Assistant
Gradle is still spinning up. I'll wait for the monitor notification rather than polling further.
- Assistant
The build is still in progress. I'll wait for it to complete — the background task will notify when done.
- Assistant
I'll stop polling and wait for the monitor notifications to arrive.
- Assistant
Waiting on the build — I'll report back when the monitor fires.
- Assistant
I'm now waiting for the test run to complete; the background waiters will notify me with the result.
- Assistant
Compilation succeeded — both the fix and the test compile cleanly. The original test run should complete shortly since the daemon now has everything cached.
- Assistant
Waiting on the gradle test run — I'll report the results as soon as the monitor notifies me.
- Assistant
Original stalled run killed. Now running the test again — compile caches are warm:
- Assistant
Build successful. Let me verify the tests actually ran and passed:
- Assistant
Both tests pass — and the captured stderr nicely confirms the behavior split: the "schedule is blocked" warning still fires for the
POLLINGtrigger, while theREALTIMEone is skipped entirely.Summary
Problem:
TriggerSchedulerMonitoriterates over all locked triggers every 10s and warns "No execution found, schedule is blocked" for any locked trigger without an execution. But realtime triggers are locked for their entire lifetime by design — the worker holds the lock while listening for events, and no execution exists until an event arrives — so they were reported as blocked indefinitely (and polluted thescheduler.execution.missing.durationmetric).Fix (
scheduler/src/main/java/io/kestra/scheduler/TriggerSchedulerMonitor.java:64-68): skip triggers withTriggerType.REALTIMEin the monitoring loop, using the samestate.getType()discriminator already used byTriggerEventHandler.maySendExecutionKilledfor realtime handling.Test (): new Mockito unit test with two cases:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.