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 finding the relevant files related to the issue.
Assistant
I'll search for the relevant files one at a time.
Assistant
Now let me look at the
TriggerTypeenum to understand the different trigger types:Assistant
Now I understand the issue. The
TriggerSchedulerMonitorchecks all locked triggers and reports them as blocked if no execution is found. But realtime triggers will always be locked without an execution ID, so they get reported indefinitely. Let me look at howfindTriggersEligibleForSchedulingworks:Assistant
Now I have a clear understanding of the issue. The
TriggerSchedulerMonitorretrieves all locked triggers and reports them as blocked if no execution is found. For realtime triggers (like Kafka), they're always locked (continuously listening for events) and don't have executions tied to the lock state, so they get reported indefinitely as blocked.The fix is to filter out realtime triggers from this monitoring. Let me look at the
TriggerStateclass to confirm the type field is accessible:Assistant
The
typefield is accessible via thegetType()getter (Lombok@Getter). Now let me look at the existing tests forTriggerSchedulerMonitor:Assistant
Let me look at the scheduler test directory and understand the test patterns:
Assistant
Now let me look at the
findAllByTriggermethod to understand how executions are queried for realtime triggers:Assistant
Now I have a clear understanding of the issue. The
TriggerSchedulerMonitormonitors all locked triggers. For realtime triggers (like Kafka), they are always locked because they continuously listen for events, but there's no execution tied to that lock state. The monitor keeps checking for an execution and finding none, reports them as blocked indefinitely.The fix is to filter out realtime triggers from this monitoring. Let me implement this:
Assistant
Now I'll implement the fix. I need to:
- Import
TriggerType - Filter out realtime triggers since they are always locked and don't have executions tied to the lock state
- Import
Assistant
Now let me add the filter to skip realtime triggers. I'll modify the
forEachlambda to skip realtime triggers:Assistant
The changes look good. Now let me verify the file compiles correctly by building the scheduler module:
Assistant
The code compiles successfully. Now let me run the existing scheduler tests to make sure I didn't break anything:
Assistant
All 75 tests pass. Let me also review the final state of the modified file to confirm the changes are correct:
Assistant
The changes are clean and focused. Let me also check if there are any edge cases I should consider. Let me verify that the
getType()method can returnnull(sinceTriggerType.from()can returnnullfor unsupported triggers):Assistant
The
getType()method can returnnullfor unsupported triggers, but the comparisonstate.getType() == TriggerType.REALTIMEhandles this correctly — ifgetType()isnull, the comparison returnsfalse, so the trigger still goes through normal monitoring (which is the correct behavior; we only skip realtime triggers).Let me view the final file one more time to confirm everything is in order:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →
Qwen/Qwen3.6-27BCompare side by side →