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 start by exploring the repository structure to understand what we're working with.
Assistant
Let me explore the structure to find the
TriggerSchedulerMonitor.Assistant
Let me look at the file.
Assistant
Let me look for realtime triggers to understand the difference.
Assistant
Let me look at the RealtimeTriggerInterface to understand realtime triggers better.
Assistant
Let me look at how realtime triggers are processed in the scheduler.
Assistant
Let me search for how realtime triggers become locked.
Assistant
Let me check how realtime triggers communicate execution creation back to the scheduler.
Assistant
Let me look at
findAllByTriggerto understand what it does.Assistant
Let me look at the FindTriggersEligibleForScheduling to understand what triggers are eligible.
Assistant
Let me check the tests for the TriggerSchedulerMonitor.
Assistant
Let me check the git log to see the recent changes.
Assistant
Let me look at the migrations and related repository code.
Assistant
Let me check how executions store the trigger info.
Assistant
Let me check how realtime triggers trigger executions.
Assistant
Let me look at the implementation of findAllByTrigger.
Assistant
Let me check the TriggerId.uid() method.
Assistant
Let me look at how the execution trigger id is stored.
Assistant
Let me look at the AbstractTrigger.
Assistant
Let me look at the tests to verify how findAllByTrigger is used.
Assistant
Let me look at WorkerTrigger.
Assistant
Let me check how the ExecutionTrigger is built when a worker triggers an execution.
Assistant
Let me look more carefully at the trigger.id vs trigger.uid() to confirm my suspicion.
Assistant
Let me look at updateOnExecutionCreated.
Assistant
Let me also look at the AbstractJdbcTriggerRepository.
Assistant
Let me check production code more carefully to understand the trigger.id vs uid.
Assistant
Let me check what the current TriggerSchedulerMonitor test does.
Assistant
Let me check how SchedulableExecutionFactory creates ExecutionTrigger.
Assistant
Let me look at how the in-memory implementation of findTriggersEligibleForScheduling works.
Assistant
Let me search for places where executionRepository is queried with trigger.
Assistant
Let me check the git history of the migration files.
Assistant
Let me look at how the production code constructs the ExecutionTrigger.
Assistant
Now let me write a simple reproduce script first.
Assistant
Now let me look at the imports in TriggerSchedulerMonitor to understand what's already imported.
Assistant
Now let me apply the fix to skip realtime triggers in the monitor.
Assistant
Let me undo that and use a different approach.
Assistant
Now let me make the fix properly using the multi-line edit syntax.
Assistant
Now let me add the skip for realtime triggers.
Assistant
There's a duplicate line. Let me fix that.
Assistant
The file got messed up. Let me reset and rewrite properly.
Assistant
Now let me apply the fix properly using the multi-line edit syntax.
Assistant
Now let me add the skip logic for realtime triggers.
Assistant
Now I need to add the import for
Predicate.Assistant
Let me reset and try a clean approach using a different command.
Assistant
Now let me apply the fix properly using the heredoc approach.
Assistant
Let me look at how the trigger is parsed from the YAML.
Assistant
Let me look at the in-memory test repository and verify my fix doesn't break the test.
Assistant
Hmm, the repository-memory module doesn't have many files. Let me check what's in the
coremodule for the in-memory implementation.Assistant
Let me search for places where the trigger.id might be set to UID.
Assistant
Let me verify the file compiles correctly.
Assistant
The compilation is successful. Let me verify the file once more.
Assistant
Let me now check the existing tests to ensure nothing is broken.
Assistant
All existing scheduler tests pass. Let me also verify the H2 test for executions.
Assistant
Let me clean up the code to use a cleaner pattern.
Assistant
Let me rewrite the file with a simpler approach.
Assistant
Let me check who creates TriggerState.
Assistant
Let me also verify the build compiles with the new code.
Assistant
Let me check tests that might be related to the monitor.
Assistant
Let me run the scheduler tests once more.
Assistant
All 75 scheduler tests pass. Let me also run the jdbc-h2 tests.
Assistant
Let me verify the final diff.
Assistant
Let me also check if there are other repositories that might have specific implementations.
Assistant
Let me also check git status to ensure no other files are affected.
Assistant
Only the TriggerSchedulerMonitor.java is modified. Let me see the final diff:
Assistant
Let me clean up the test script.
Assistant
Let me do one final check to verify the fix is complete.
Assistant
Now let me write a quick reproduction script to verify the fix works.
Assistant
Let me clean up.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.