ISSUE DESCRIPTION The TriggerSchedulerMonitor reports realtime triggers as locked…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /kestra, current file: none) bash-$
- Assistant
I'll start by exploring the repository structure and locating the
TriggerSchedulerMonitorrelated code. - Assistant
Found the monitor class. Let me examine it along with related trigger code.
- Assistant
Next I'll look at realtime triggers and how locked/blocked schedule status is determined.
- Assistant
Let me look at TriggerState more closely, how locking works for realtime triggers, and how findTriggersEligibleForScheduling works.
- Assistant
I'll inspect TriggerState, TriggerType, and how findAllByTrigger works for realtime triggers.
- Assistant
Realtime triggers stay locked by design. I'll check recent changes and how the monitor treats them.
- Assistant
Let me look at the TriggerScheduler lock logic more carefully and git show the fix for TriggerSchedulerMonitor.
- Assistant
I'll also check git history and related PR notes for intended behavior around realtime trigger locking.
- Assistant
I'll check how unlock works for realtime trigger permissions in TriggerEventHandler.
- Assistant
Let me look at line 368 and surrounding code for realtime handling.
- Assistant
Let me track how lock state is updated when realtime executions are created or terminate.
- Assistant
Checking how worker unlocks polling/realtime triggers after evaluation.
- Assistant
The issue is specifically about realtime triggers. The fix is to filter them out in the monitor. I think the core issue is clear: realtime triggers are being treated as "locked" in the scheduler monitor, which causes them to spam the logs indefinitely since they never get an execution ID.
- Assistant
I'll update
TriggerSchedulerMonitorto skip realtime triggers since they stay locked by design. - Assistant
Let me implement the fix.
- Assistant
Now let me update the forEach body to skip realtime triggers.
- Assistant
I'll verify the fix against the old monitor implementation and any existing tests.
- Assistant
Let me look at how the old AbstractScheduler handled this monitoring - specifically around "schedule is blocked"
- Assistant
Hmm empty? Let me try differently.
- Assistant
In the old code, locked triggers had an executionId. Realtime triggers wouldn't have been found via that path if they don't have executionId. Let me read that section.
- Assistant
I'll verify how WorkerTriggerResult updates lock state after evaluation.
- Assistant
Hmm only that. Let me search more broadly.
- Assistant
Looking at the controller handling of realtime:
- Assistant
Checking how unlock behaves for polling empty evaluations and realtime locks.
- Assistant
Confirming how allowConcurrent defaults for AbstractTrigger and whether polling stays locked after empty evaluation.
- Assistant
Looking at onTriggerEvaluated when evaluation is null - it updates nextEvaluationDate but doesn't unlock. Looking at findTriggersEligibleForScheduling:
- Assistant
Looking at AbstractTrigger for allowConcurrent default.
- Assistant
I'll check whether updateForNextEvaluationDate or updateOnExecutionCreated clears the lock.
- Assistant
I'll check the old scheduler for how it unlocked polling triggers.
- Assistant
Let me search for the receive of workerTriggerResultQueue
- Assistant
The realtime skip is enough for this issue. Compiling the scheduler module to verify.
- Assistant
Compilation succeeded. Checking the final diff and whether related tests can run.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.