-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 Priorityqueue: Yet another queue_depth metric fix #3085
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,7 @@ func (w *priorityqueue[T]) AddWithOpts(o AddOpts, items ...T) { | |
} | ||
|
||
if item.ReadyAt != nil && (readyAt == nil || readyAt.Before(*item.ReadyAt)) { | ||
if readyAt == nil { | ||
if readyAt == nil && !w.becameReady.Has(key) { | ||
w.metrics.add(key) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be sure. Do we also have to add it to becameReady here? w.becameReady.Insert(item.Key) I'm not sure if we otherwise still have another edge case where we count twice Should we maybe simply always add it to becameReady when we call metrics.add? If I see correctly we always remove it from there when we get the item out of the queue, so it should be fine to always add it? (might also make sense to rename becameReady to something that expresses that an item is currently counted in the queue depth or something) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason that isn't needed is that in I've extended the two last tests that validate that we do call I do agree the current name isn't great but I couldn't come up with a better one - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also no better ideas for the name :) |
||
} | ||
item.ReadyAt = readyAt | ||
|
Uh oh!
There was an error while loading. Please reload this page.