Feature to exclude future jobs from queue depth#68
Merged
j4mie merged 4 commits intodabapps:masterfrom Feb 25, 2025
Merged
Conversation
New arg exclude_future_jobs filters the READY and NEW jobs to only be ones without a run_after or the run_after is now/in the past
The queue_depth command can call get_queue_depths with the option to exclude jobs in the future
j4mie
approved these changes
Feb 25, 2025
Member
j4mie
left a comment
There was a problem hiding this comment.
Nice, thank you! Arguably this should be the default behaviour (this was definitely an oversight) but let's merge this as-is so we don't need a major version bump, and consider reversing the default in a future version.
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.
New feature:
exclude_future_jobsforget_queue_depthsWhen using
get_queue_depthsto get the queue depth health for metrics and health it includes all READY/NEW jobs regardless ofrun_after. This is artificially inflating the depth for our use case where many jobs are being created to run at a time in the future and are not really contributing to the current queue backlog.As an option to handle this, in this PR I have added a kwarg
exclude_future_jobswhich applies a filter to the jobs contributing to the queue depth count where jobs with arun_afterand it is in the future are ignored. This is available both via the model API and through thequeue_depthmanagement command.To maintain existing compatability this is optional and by default continues to use existing behaviour.