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

Refine informer usage in deduper #436

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Conversation

DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Nov 26, 2024

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.

@DrJosh9000 DrJosh9000 force-pushed the refine-deduper-informer branch from 14a52fc to 729c164 Compare November 26, 2024 01:03
Copy link
Contributor

@wolfeidau wolfeidau left a 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!",
Copy link
Contributor

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?

Copy link
Contributor Author

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).

Copy link
Contributor Author

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? 🤔

Copy link
Contributor Author

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.

@DrJosh9000 DrJosh9000 force-pushed the refine-deduper-informer branch from 729c164 to c96f3d5 Compare November 26, 2024 02:04
@DrJosh9000 DrJosh9000 force-pushed the refine-deduper-informer branch from c96f3d5 to 98dbb84 Compare November 26, 2024 02:14
@DrJosh9000 DrJosh9000 requested a review from wolfeidau November 26, 2024 02:14
Copy link
Contributor

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 🚀

@DrJosh9000 DrJosh9000 merged commit a54f600 into main Nov 26, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the refine-deduper-informer branch November 26, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants