-
Notifications
You must be signed in to change notification settings - Fork 508
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
fix red herring in the readinessProbe #1504
Conversation
// In that case, we don't want to panic to show the message | ||
// in the kubernetes description. That would be a red herring, since that will solve itself with enough time. | ||
if err != nil { | ||
os.Exit(1) |
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.
can we log something here to indicate what happened?
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.
I was thinking about the same, but then I would need to move the logger initialization out to fit the logger:
mongodb-kubernetes-operator/pkg/readiness/config/config.go
Lines 59 to 64 in a7812ff
logger := &lumberjack.Logger{ | |
Filename: readinessProbeLogFilePath(), | |
MaxBackups: readIntOrDefault(readinessProbeLoggerBackups, 5), | |
MaxSize: readInt(readinessProbeLoggerMaxSize), | |
MaxAge: readInt(readinessProbeLoggerMaxAge), | |
} |
I could do this 🤔
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.
How about panicing with an error? This way it should be visible in the kubectl get events
and kubectl describe pod
.
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.
ahh so the root cause of most red herrings are that exact error/panic.
Note the comment:
// In that case, we don't want to panic to show the message
// in the kubernetes description. That would be a red herring, since that will solve itself with enough time
That error almost always happens because we are calling the probe before the agent was able to create the health status file.
Regarding adding the log, I am not sure whether this effort is worth to log it 🤔
@lsierant @slaskawi
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.
Thanks for the explanation @nammn ! I believe it's still worth logging an info why this happened. Without it, investigating corner cases might be simply impossible.
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.
Done
All Submissions:
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if such).Summary