-
Notifications
You must be signed in to change notification settings - Fork 820
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
Stop logging Pods without Nodes yet as an Error #2014
Stop logging Pods without Nodes yet as an Error #2014
Conversation
Build Succeeded 👏 Build Id: 26ba2997-b2f6-4bd2-a6c1-108bafcb45e7 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
pkg/util/workerqueue/workerqueue.go
Outdated
@@ -37,6 +37,29 @@ const ( | |||
workFx = time.Second | |||
) | |||
|
|||
// DebugError is a marker type for errors that that should only be logged at a Debug level. | |||
// Useful if you want a Handler to be retried, but not logged at an Error level. | |||
type DebugError struct { |
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.
Is this type intended to be used outside of this package? Given that the constructor below returns error
it seems like this should be package scoped and callers should use NewDebugError
to create them.
b4e6533
to
1a2296f
Compare
Done! This should be good to go now. 👍 |
1a2296f
to
b26e212
Compare
Build Succeeded 👏 Build Id: 2d7115c2-6a16-4f0b-a4e7-100606d3bf94 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
pkg/util/workerqueue/workerqueue.go
Outdated
// Error returns the error string | ||
func (l *debugError) Error() string { | ||
if l.err == nil { | ||
return "nil" |
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.
Should this be return ""?
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 went back and forth on that. In the rare occurrence in which it could be nil
I thought it might be handy to be able to easily see that. Empty string so often disappears amongst other things.
Maybe it should be "<nil>" like the playground then?
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 meant to put "", I guess I didn't paste the middle part in though.
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.
When I go to edit your comment, I see you wrote <nil>
, which gets escaped by Github! Cool. I'll make this change 😄
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.
.....and done!
@@ -194,3 +195,14 @@ func TestWorkerQueueEnqueueAfter(t *testing.T) { | |||
assert.Fail(t, "should have got a queue'd message by now") | |||
} | |||
} | |||
|
|||
func TestIsDebugError(t *testing.T) { |
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.
a nit but this doesn't just test IsDebugError any longer, so it should be renamed to TestDebugError instead.
b26e212
to
efc00f0
Compare
Build Failed 😱 Build Id: 203cd8c4-a3ce-44a3-b570-7392332ab066 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 9185cd2b-71e3-45c7-902b-ad9d2fa5f5aa To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: abd7ca2a-2893-4401-a932-ab9dc9daa0c1 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Hmnn. Lots of flakiness agian
|
This one seems common 🤔 |
Build Failed 😱 Build Id: 718ad84a-10f2-4ec8-bd03-fdcdc08b88d3 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 79fa2378-004d-40e7-8e7d-c2eef83a5f7b The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
ERMAGHERD THAT WAS A ROUGH ONE |
A common debugging red herring I see is people seeing an error that reads something akin to: ``` "message":"error retrieving node for Pod game-servercbtld: node \"\" not found","severity":"error" ``` And (not unsurprisingly, it's an `error`) wondering if it causing whatever issue they are having with Agones. Except these errors are totally expected, and normal, as Pods often aren't populated with the Node they live on straight away, so I wanted to have a way to be able to return an error from a workerqueue Handler function to retry, but not have it be logged at an Error level. So that's what this does - provide a wrapper Error type that only gets logged at the Debug level, and the corresponding changes to make that error message above be logged at the Debug level and not cause so much noise.
009dac6
to
0640590
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markmandel, roberthbailey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Build Failed 😱 Build Id: 4a6f2a4d-52bb-41e9-9378-07f137447cdc To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
New changes are detected. LGTM label has been removed. |
Build Failed 😱 Build Id: 2f0ee545-4b21-418d-92cf-1ca501ede07d To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
That's a legit flake. |
Build Succeeded 👏 Build Id: 94797748-8580-4db1-9f73-7d7cf080ecc5 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
What type of PR is this?
/kind cleanup
What this PR does / Why we need it:
A common debugging red herring I see is people seeing an error that reads something akin to:
And (not unsurprisingly, it's an
error
) wondering if it causing whatever issue they are having with Agones.Except these errors are totally expected, and normal, as Pods often aren't populated with the Node they live on straight away, so I wanted to have a way to be able to return an error from a workerqueue Handler function to retry, but not have it be logged at an Error level.
So that's what this does - provide a wrapper Error type that only gets logged at the Debug level, and the corresponding changes to make that error message above be logged at the Debug level and not cause so much noise.
Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
If anyone has a better name than "DebugError" please suggest. I wasn't 100% happy, but couldn't come up with anything better.