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

Add job UUID to limiter debug logs in informer callbacks #439

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

DrJosh9000
Copy link
Contributor

It's not relevant to how the limiter works currently, but interesting to see which jobs affect the limiter.

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

// Before sync is finished: we're learning about existing jobs, so we should
// (try to) take tokens for unfinished jobs started by a previous controller.
// If it's added as already finished, no need to take a token for it.
// Otherwise, try to take one, but don't block (in case the stack was
// restarted with a different limit).
if !model.JobFinished(job) {
l.tryTakeToken("OnAdd")
l.logger.Debug("existing not-finished job discovered", zap.Int("tokens-available", len(l.tokenBucket)))
l.logger.Debug("existing not-finished job discovered",
zap.String("uuid", job.Labels[config.UUIDLabel]),
Copy link
Contributor

Choose a reason for hiding this comment

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

should it be called job uuid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. For consistency I've changed it everywhere a job UUID field is logged.

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 feeabb1 into main Nov 28, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the uuid-in-limiter-logs branch November 28, 2024 05:17
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