Skip to content

Commit

Permalink
MultiCluster Allocation: Cleanup on error logs (googleforgames#1862)
Browse files Browse the repository at this point in the history
Just switching to .WithError() on the failure for multi cluster
allocation, primarily to make it easier to use structured logs to catch
this specific use case.

Also fixed a typo.
  • Loading branch information
markmandel authored and ilkercelikyilmaz committed Oct 23, 2020
1 parent 96fcc13 commit 691fb26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/gameserverallocations/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca
c.loggerForGameServerAllocationKey("remote-allocation").WithField("request", request).WithField("endpoint", endpoint).Debug("forwarding allocation request")
allocationResponse, err = c.remoteAllocationCallback(ctx, endpoint, dialOpts, request)
if err != nil {
c.baseLogger.Errorf("remote allocation failed with: %v", err)
// If there are multiple enpoints for the allocator connection and the current one is
c.baseLogger.WithError(err).Error("remote allocation failed with")
// If there are multiple endpoints for the allocator connection and the current one is
// failing, try the next endpoint. Otherwise, return the error response.
if (i + 1) < len(connectionInfo.AllocationEndpoints) {
// If there is a server error try a different endpoint
Expand Down

0 comments on commit 691fb26

Please sign in to comment.