Repository navigation
Fix: Jobs stuck in pending state until resource manually checked or check interval elapsed - #9622
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 + intervalto 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_timecolumn 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 storelastCheckEndTime + intervalinnext_check_timeso 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 + intervalto 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.