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
Let me analyze the issue. The
TriggerSchedulerMonitoris reporting realtime triggers as locked because they don't have an executionID, but since realtime triggers will always be blocked without any executionID, they should be skipped by the monitor.Let me first explore the repository structure to understand the codebase and find the relevant files.
Assistant
Good, I found the file. Let me also search for "realtime" triggers to understand how they're identified.
Assistant
Let me search for how realtime triggers are identified in the codebase:
Assistant
Let me look at the TriggerState model to understand how triggers are stored:
Assistant
I see the
TriggerStateclass has atypefield of typeTriggerType. Let me look at this class to understand how realtime triggers are identified.Assistant
Now I understand. The
TriggerStatehas atypefield that can beREALTIME. The issue is that realtime triggers will always be locked without any executionID, so they should be skipped by theTriggerSchedulerMonitor.Let me look at the
TriggerSchedulerMonitorcode again and understand the logic:Assistant
Now I understand the issue. The
TriggerSchedulerMonitorreports locked triggers, but realtime triggers (typeREALTIME) will always be "locked" without any executionID because they work differently - they are event-driven rather than scheduled. So they should be skipped in this monitor.Let me check if there are any existing tests for this monitor:
Assistant
Let me see what other files might help understand how triggers are processed:
Assistant
Let me look at the
TriggerEventHandlerto see how REALTIME triggers are handled differently:Assistant
Not the full answer
Assistant
Let me continue exploring the codebase to understand how realtime triggers work differently and why they should be skipped in the monitor.
Assistant
Now I understand the issue. The
TriggerSchedulerMonitormonitors locked triggers and reports warnings when no execution is found. However, realtime triggers (TriggerType.REALTIME) are event-driven and will always be "locked" without an execution ID - this is expected behavior for them, so they should be skipped in the monitor.Let me make the fix:
Assistant
Now I understand the issue. The
TriggerSchedulerMonitorreports realtime triggers as locked, but realtime triggers are event-driven and will always appear locked without an executionID. This is expected behavior, so they should be skipped.Let me fix this by:
- Adding the import for
TriggerType - Adding a check to skip realtime triggers in the monitoring loop
- Adding the import for
Assistant
I need to:
- Add the import for
TriggerType - Add a check to skip realtime triggers in the monitoring loop
Let me first add the import, then modify the forEach loop to skip realtime triggers.
- Add the import for
Assistant
I need to verify the import was added correctly and then modify the loop to skip realtime triggers.
Assistant
Good, the import is added. Now I need to modify the forEach loop to skip realtime triggers. Let me view the current state of the file and make the edit.
Assistant
Now I need to add a check at the beginning of the forEach lambda to skip realtime triggers. Realtime triggers are event-driven and don't follow the normal scheduling pattern, so they should be excluded from this monitoring.
Assistant
I need to replace the forEach block in TriggerSchedulerMonitor.java to add the realtime trigger check. Let me use sed to do this replacement.
Assistant
Let me check if the sed command worked correctly by viewing the file.
Assistant
The sed command didn't work with multi-line patterns. Let me use a different approach to add the check for realtime triggers.
Assistant
The sed command didn't work with multi-line patterns and python3 is not available. Let me try using a different approach - maybe perl or awk, or I can create a new file with the corrected content.
Assistant
The command exited with a non-zero exit code, but it still showed the paths for perl and awk. Let me try using perl for the replacement.
Assistant
The change has been applied successfully. Now let me verify the change by checking if the code compiles and running any existing tests.
Assistant
Let me try to compile the code and run any existing tests related to the scheduler module.
Assistant
The code compiles successfully. Now let me check if there are any tests related to this monitor or scheduler that I can run to verify the fix doesn't break anything.
Assistant
Let me verify my changes with git diff and then run the existing tests for the scheduler module.
Assistant
The change looks correct. Let me now run the scheduler tests to make sure I didn't break anything.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.