-
Notifications
You must be signed in to change notification settings - Fork 37
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
Refine informer usage in deduper #436
Conversation
14a52fc
to
729c164
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one observation.
// Change state from in-flight to not in-flight. | ||
numInFlight, ok := d.casa(id, false) | ||
if !ok { | ||
d.logger.Debug("markComplete: job was already not-in-flight!", | ||
d.logger.Debug("markNotRunning: job was already not-in-flight!", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this double negative something which is easy to understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, I've renamed it back to markFinished
(markComplete
sounded to me as though the job succeeded, when it might not have).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe it should be unmarkRunning
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe including the method name is not useful, given that zap includes the file and line number.
729c164
to
c96f3d5
Compare
c96f3d5
to
98dbb84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 🚀
Apply things learned in #432 to the deduper, mainly to reduce debug log noise.
Since we can use the information provided by Informer to tell when a job transitions between running and not-running without having to consult the deduping map, we can avoid logging "was already {,not-}in-flight!" when the lack of a state change is expected.