Skip to content

Fix: Jobs stuck in pending state until resource manually checked or check interval elapsed - #9622

Merged
taylorsilva merged 1 commit into
masterfrom
9620-jobs-pending
Jun 26, 2026
Merged

taylorsilva merged 1 commit into
masterfrom
9620-jobs-pending

Conversation

@taylorsilva

@taylorsilva taylorsilva commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

Changes proposed by this PR

closes #9620

We have MULTIPLE places where we check "has the interval for this resource elapsed?". We were previously using LastCheckEndTime + interval to answer this question in all these different places across the code base (db and runtime layers).

When I made the latest change to the scheduler, I added the next_check_time column to resource config scopes. I added that column because there wasn't an existing way to pull out the interval of a resource and determine if it had elapsed. The interval of a resource is stored in the config column of the resources table, which makes it not queriable. Therefore I had us store lastCheckEndTime + interval in next_check_time so I could easily determine if the interval had elapsed or not. This created two sources of truth that could conflict, which is what resulted in this bug.

This PR now migrates everything (I think) to use NextCheckTime instead of LastCheckEndTime + interval to determine if a resource needs to be checked or not.

Issue #9620 has steps for manually reproducing. I verified that this PR resolves the issue by following those steps.

We have MULTIPLE places where we check "has the interval for this
resource elapsed?". We were previously using `LastCheckEndTime +
interval` to answer this question in all these different places across
the code base (db and runtime layers).

When I made the latest change to the scheduler, I added the
`next_check_time` column to resource config scopes. I added that column
because there wasn't an existing way to pull out the interval of a
resource and determine if it had elapsed. The interval of a resource is
stored in the config column of the resources table, which makes it not
queriable. Therefore I had us store `lastCheckEndTime + interval` in
`next_check_time` so I could easily determine if the interval had
elapsed or not. This created two sources of truth that could conflict,
which is what resulted in this bug.

This commit now migrates everything (I think) to use NextCheckTime
instead of `LastCheckEndTime + interval` to determine if a resource
needs to be checked or not.

Signed-off-by: Taylor Silva <[email protected]>
@taylorsilva
taylorsilva requested a review from a team June 26, 2026 16:10
@taylorsilva
taylorsilva merged commit fbab9ac into master Jun 26, 2026
11 checks passed
@taylorsilva
taylorsilva deleted the 9620-jobs-pending branch June 26, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Job stuck in pending even though all input checks have passed/ran (Global resources enabled)

1 participant