-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
🌱 Do not deduplicate warnings by default #2953
base: main
Are you sure you want to change the base?
🌱 Do not deduplicate warnings by default #2953
Conversation
Controllers are long-running processes, and deduplication, as implemented, increases memory use. With this change, duplicate warnings will appear in the log by default. However, this is safe, because Kubernetes rotates container logs by default. If a specific controller sees many duplicate warnings, it can configure the handler to deduplicate them.
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dlipovetsky The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Absolutely in favor of this change. The current default is a memory leak and I think the behavior is also questionable /lgtm /assign @alvaroaleman @vincepri |
LGTM label has been added. Git tree hash: 9bc8e9a4c90d0b860976c2fffeff13e19c7e9c43
|
It takes some memory but how is it a leak? The number of unique warnings should be pretty finite or not? |
Good point. Is the number of unique warnings finite? (i.e. is there a guarantee that they never contain variable parts like object names?) (IIRC every webhook is able to return warnings, so we have more than just the warnings built into the kube-apiserver to consider) But independent of that part, I think it's surprising behavior that we log every unique warning only once. I mean I wonder in general who notices these warnings in controller logs, but only logging them once doesn't make it better :) |
Yeah I am a bit thorn on this. On the one hand if this was net new I would keep them on because as you said, its easy to miss them if they are only logged once. On the other you can make the argument that this is a silently breaking change and ppl might complain about now getting too many warnings that they don't care about logged. |
Yup. We can also consider defaulting to no warning handler. Then people can add it if they want |
This came out a discussion in a cluster-api PR: kubernetes-sigs/cluster-api#11179 (comment) I think deduplication can make it harder to spot warnings. This is what I said there:
|
(The above was incorrect) |
From what I can see there it only includes the fieldpath and the value but not object name or am I missing it? |
My mistake! You're right, the object name is not part of the message. |
Controllers are long-running processes, and deduplication, as implemented, increases memory use.
With this change, duplicate warnings will appear in the log by default. However, this is safe, because Kubernetes rotates container logs by default.
If a specific controller sees many duplicate warnings, it can configure the handler to deduplicate them.