-
Notifications
You must be signed in to change notification settings - Fork 2
chore(vm): reduce noise in logs about "namespaces not found" #1566
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
base: main
Are you sure you want to change the base?
Conversation
Do not requeue reconcile if status was not updated with error "namespaces ... not found". Just print Warning in this situation. Signed-off-by: Ivan Mikheykin <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduce a new branch in the reconcile handler that intercepts namespace-not-found errors, logs them as warnings, and suppresses requeueing, reducing log noise during e2e tests. Sequence diagram for updated error handling in VM reconcile processsequenceDiagram
participant Controller
participant Logger
participant KubernetesAPI
Controller->KubernetesAPI: Update resource status
KubernetesAPI-->>Controller: Error (namespace not found)
Controller->Logger: Warn("Namespace is gone while reconcile the object")
Note over Controller: No requeue triggered
Class diagram for updated error handling in ReconcilerclassDiagram
class Reconciler {
+reconcile()
}
Reconciler : +handlersLoop
Reconciler : -case k8serrors.IsNotFound(err) && strings.Contains(err.Error(), "namespaces")
Reconciler : +Warn("Namespace is gone while reconcile the object")
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- Matching on the ‘namespaces’ substring in err.Error() is brittle—consider using apierrors.StatusError and inspecting Status().Details.Kind to robustly identify namespace-not-found errors.
- Revisiting whether skipping the requeue entirely on namespace-not-found is safe for all scenarios, or if a deferred requeue with backoff might better handle transient deletion races.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Matching on the ‘namespaces’ substring in err.Error() is brittle—consider using apierrors.StatusError and inspecting Status().Details.Kind to robustly identify namespace-not-found errors.
- Revisiting whether skipping the requeue entirely on namespace-not-found is safe for all scenarios, or if a deferred requeue with backoff might better handle transient deletion races.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Warning is not enough here. May be we should add metric and alert for such cases. The problem was that VM stuck in Terminating state but NS was forced to delete. |
Description
Do not requeue reconcile if status was not updated with error "namespaces ... not found". Just print Warning in this situation.
Why do we need it, and what problem does it solve?
This situation is not an error, but it fails e2e tests with this messages:
What is the expected result?
Reduce number of false-negative e2e runs.
Checklist
Changelog entries