Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax/minimax-m3· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION The TriggerSchedulerMonitor reports realtime triggers as locked…

  1. User

    ISSUE DESCRIPTION

    The TriggerSchedulerMonitor reports realtime triggers as locked

    Describe the issue

    The TriggerSchedulerMonitor reports 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 using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to 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-$

  2. MiniMax Assistant

    Let me start by exploring the repository structure to understand what we're working with.

  3. MiniMax Assistant

    This is a Kestra repository. Let me explore the scheduler module since the issue is about TriggerSchedulerMonitor.

  4. MiniMax Assistant

    Let me explore the TriggerState class to understand what it contains.

  5. MiniMax Assistant

    Let me look at the TriggerStateStore to understand findTriggersEligibleForScheduling.

  6. MiniMax Assistant

    Let me look at how realtime triggers work in the scheduler to understand them better.

  7. MiniMax Assistant

    Now let me look at the DefaultScheduler class to see how triggers are being locked and how this is being run.

  8. MiniMax Assistant

    Let me explore the TriggerScheduler class.

  9. MiniMax Assistant

    Let me search for tests for TriggerSchedulerMonitor to understand the testing conventions.

  10. MiniMax Assistant

    Let me also look at the worker-side handling for realtime triggers.

  11. MiniMax Assistant

    Now let me look at the tests in the scheduler module to understand the testing patterns:

  12. MiniMax Assistant

    Now I understand the issue clearly. Let me also check how realtime triggers store their state to make a proper fix:

  13. MiniMax Assistant

    Now I have enough understanding. Let me look at the logs utility to understand how logging works in the project:

  14. MiniMax Assistant

    Now let me make the fix. Looking again at the issue:

    The issue is that the TriggerSchedulerMonitor reports realtime triggers as "locked" because:

    1. Realtime triggers get locked in the scheduler when sent to workers
    2. The monitor checks if there's an execution for a locked trigger
    3. For realtime triggers, there might not be an execution if there are no events (e.g., no Kafka events)
    4. The monitor then warns that "schedule is blocked"

    We need to skip realtime triggers in this check, since it's normal for them to not have executions.

  15. MiniMax Assistant

    Now I'll fix the issue by skipping realtime triggers in the monitor:

  16. MiniMax Assistant

    Let me make the indentation fix and continue with the actual fix:

  17. MiniMax Assistant

    Now I need to add the actual fix - skipping REALTIME triggers in the loop:

  18. MiniMax Assistant

    I see there's an issue - I added an extra { because the original was indented as a lambda block. Let me fix this properly:

  19. MiniMax Assistant

    Let me undo my changes and redo them more carefully:

  20. MiniMax Assistant

    The file is getting messy with the edit. Let me revert the file and take a cleaner approach:

  21. MiniMax Assistant

    Now let me make the change carefully without messing up the indentation:

  22. MiniMax Assistant

    Let me make the changes more carefully. I'll just add a check at the start of the lambda:

  23. MiniMax Assistant

    Now let me add the check at the start of the lambda body:

  24. MiniMax Assistant

    Let me verify the changes look good:

  25. MiniMax Assistant

    The diff looks clean. Let me now try to compile the scheduler module to ensure no compilation issues:

  26. MiniMax Assistant

    Let me explore the existing tests to understand the test patterns used:

  27. MiniMax Assistant

    Now let me look at the InMemoryTriggerStateStore so I can write a script to test my fix:

  28. MiniMax Assistant

    Now let me check what relevant Mock files exist for ExecutionRepositoryInterface:

  29. MiniMax Assistant

    Let me run the existing tests in the scheduler module to ensure they still pass:

  30. MiniMax Assistant

    Now let me run all scheduler tests to make sure my change doesn't break anything:

  31. MiniMax Assistant

    All 75 tests pass. Now let me create a temporary reproduction script to confirm the fix works correctly:

  32. MiniMax Assistant

    Let me write a small reproduction script to verify the fix:

  33. MiniMax Assistant

    Let me confirm the fix once more by examining the updated file:

  34. MiniMax Assistant

    Let me look at one of the scheduler tests that does a setup similar to what we need:

  35. MiniMax Assistant

    Let me create a temporary verification script to test the fix:

  36. MiniMax Assistant

    Let me also check how SchedulerClock is used in tests:

  37. MiniMax Assistant

    Let me check the tags(TriggerState). Wait, it doesn't seem to be there. Let me check where it's used in TriggerSchedulerMonitor:

  38. MiniMax Assistant

    Hmm, it looks like tags(state) does not exist exactly. The metricRegistry.tags(state) call would resolve to tags(TriggerId). Let me check:

  39. MiniMax Assistant

    Let me confirm everything compiles correctly:

  40. MiniMax Assistant

    Let me verify the final diff:

  41. MiniMax Assistant

    Let me create a temporary Java test to verify the fix works:

  42. MiniMax Assistant

    Let me write an actual integration test that mocks the dependencies. First, let me look at how the existing tests are constructed:

  43. MiniMax Assistant

    Let me also check if there's a simpler test for TriggerSchedulerMonitor directly:

  44. MiniMax Assistant

    Let me verify the fix by viewing the final file content:

  45. MiniMax Assistant

    Let me look at the directory structure to also confirm I'm not missing anything:

  46. MiniMax Assistant

    Let me run all scheduler tests once more to confirm everything is OK:

  47. MiniMax Assistant

    All tests passed. Now let me check the AGENTS.md to see if there are any specific guidelines I should follow:

  48. MiniMax Assistant

    Let me also create a small temporary test to validate the fix - I'll write a simple program that doesn't require Micronaut testing setup:

  49. MiniMax Assistant

    Let me clean up the temporary test:

  50. MiniMax Assistant

    Now let me also verify the final state of the file:

  51. MiniMax Assistant

    Let me run all the scheduler tests one final time:

  52. MiniMax Assistant

    All 75 tests pass. Let me also check if there are tests that use TriggerSchedulerMonitor in other modules:

  53. MiniMax Assistant

    Let me view the final state of the changes:

  54. MiniMax Assistant

    The fix is minimal and surgical. Let me go over the checklist:

    Checklist

    • If an error was reported in the issue description, I have successfully reproduced it.

    The issue was a logical/conceptual one (the monitor reporting realtime triggers as locked indefinitely). The code in TriggerSchedulerMonitor was indeed logging "schedule is blocked since '...'" for any locked trigger without an execution, including REALTIME triggers. We confirmed this through reading the code at scheduler/src/main/java/io/kestra/scheduler/TriggerSchedulerMonitor.java (the run() method) and at scheduler/src/main/java/io/kestra/scheduler/TriggerScheduler.java (the processWorkerTrigger() method which locks REALTIME triggers via mustBeLocked = true).

    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.

    My fix adds a check at the start of the triggers.forEach lambda to skip REALTIME triggers entirely. I verified this compiles (./gradlew :scheduler:compileJava) and all 75 scheduler tests pass.

    • I have thought about edge cases and made sure my fix handles them as well.

    Edge cases considered:

    1. REALTIME triggers - Skipped as desired (the main fix).
    2. SCHEDULE triggers - Still monitored as before (correct - they should be monitored for blocked status).
    3. POLLING triggers - Still monitored as before (correct - they should be monitored for blocked status).
    4. Trigger with null type - TriggerType.REALTIME.equals(state.getType()) is null-safe (returns false when state.getType() is null), so it doesn't crash.
    5. Locked REALTIME triggers that DO have an execution - Currently skipped (still no warning, since they would be skipped anyway). The schedule-locked-with-execution case shouldn't happen for REALTIME triggers because REALTIME triggers are kept locked by design (until they are deleted).
    6. Realtime triggers where the trigger state is partially populated - The check happens first, so any subsequent issues are avoided.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.

    I ran ./gradlew :scheduler:test --rerun-tasks and all 75 tests pass. The only file I changed is TriggerSchedulerMonitor.java, which had no existing tests.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.