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

Cleanup Patch Sidecar Logging #3973

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

markmandel
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Missed this little of nuance in code review when moving to Patch with the SDK Sidecar - in that a Patch operation doesn't return a Conflict error type/status value if it fails, so every time it does, the Agones sidecar will log it as an error on production installs.

So this cleaned up a few things:

  • renamed "debugError" type to "traceError" type, since we only log it under Trace, not Debug.
  • if patchGameServer fails under the error IsInvalid, wrap it in a TraceError so it doesn't show up in prod.
  • Wrapped the error with errors context, such that if the patch does fail, it's far easier now to work out where it failed.

Which issue(s) this PR fixes:

Closes #3967

Special notes for your reviewer:

@markmandel markmandel added the area/operations Installation, updating, metrics etc label Aug 28, 2024
@markmandel markmandel requested review from gongmax and igooch August 28, 2024 11:11
@github-actions github-actions bot added kind/bug These are bugs. size/S labels Aug 28, 2024
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 74589f1c-5abe-4017-b56d-b22785ad1dba

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:

git fetch https://github.com/googleforgames/agones.git pull/3973/head:pr_3973 && git checkout pr_3973
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-c60b1f2

@@ -457,7 +458,12 @@ func (s *SDKServer) patchGameServer(ctx context.Context, gs, gsCopy *agonesv1.Ga
return nil, err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we also need to account for this error return as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just double checked - this is already wrapped, so we don't have to re-wrap it.

Also, if there is an issue with creating a patch, that's really shouldn't happen and should definitely be logged.

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 88e25500-7625-4f75-832f-6e7a4175112b

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:

git fetch https://github.com/googleforgames/agones.git pull/3973/head:pr_3973 && git checkout pr_3973
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.44.0-dev-071f92c

Missed this little of nuance in code review when moving to Patch with
the SDK Sidecar - in that a Patch operation doesn't return a Conflict
error type/status value if it fails, so every time it does, the Agones
sidecar will log it as an error on production installs.

So this cleaned up a few things:

* renamed "debugError" type to "traceError" type, since we only log it
under Trace, not Debug.
* if `patchGameServer` fails under the error `IsInvalid`, wrap it in a
TraceError so it doesn't show up in prod.
* Wrapped the error with `errors` context, such that if the patch does
fail, it's far easier now to work out where it failed.

Closes googleforgames#3967
@markmandel markmandel force-pushed the logging/sidecar-patch branch from 071f92c to 12ec087 Compare September 12, 2024 21:38
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: bd4e58ac-ec69-4e9c-88cc-4cb3861f3a30

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:

git fetch https://github.com/googleforgames/agones.git pull/3973/head:pr_3973 && git checkout pr_3973
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.44.0-dev-12ec087

@gongmax gongmax merged commit 2b7dd19 into googleforgames:main Sep 12, 2024
4 checks passed
@markmandel markmandel deleted the logging/sidecar-patch branch September 22, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/operations Installation, updating, metrics etc kind/bug These are bugs. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect error logging caused by ResourceVersion conflict on SDK Patch call
4 participants