Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #5985/b78977c3 backport][3.63] Change to use the waiting tasks in the filter for task metrics. #6017

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/5941.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed incorrect count of waiting tasks in the queue for the `tasks_unblocked_queue` and `tasks_longest_unblocked_time` metrics.
2 changes: 1 addition & 1 deletion pulpcore/tasking/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def record_unblocked_waiting_tasks_metric(self):
):
# For performance reasons we aggregate these statistics on a single database call.
unblocked_tasks_stats = (
Task.objects.filter(unblocked_at__isnull=False, started_at__isnull=True)
Task.objects.filter(unblocked_at__isnull=False, state=TASK_STATES.WAITING)
.annotate(unblocked_for=Value(timezone.now()) - F("unblocked_at"))
.aggregate(
longest_unblocked_waiting_time=Max(
Expand Down