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

Changed AllocationEndpoint to array of endpoints #830

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

pooneh-m
Copy link
Contributor

No description provided.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 27067c47-d1aa-4aa9-b092-b2c5dca83032

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

if err != nil {
return nil, err
}
if response.StatusCode >= 500 && (i+1) < len(connectionInfo.AllocationEndpoints) {
Copy link
Collaborator

@aLekSer aLekSer Jun 14, 2019

Choose a reason for hiding this comment

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

Suggested change
if response.StatusCode >= 500 && (i+1) < len(connectionInfo.AllocationEndpoints) {
if response.StatusCode >= 500 {

I think that this check is redundant for loop will not continue if we are out of range connectionInfo.AllocationEndpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. This condition says if the there is any other endpoint try sending the request with the new endpoint. Otherwise return the error. If I remove the condition, no error will be returned

@aLekSer
Copy link
Collaborator

aLekSer commented Jun 14, 2019

Thanks for the pull request. You should run make lint to check that go code is ok:

pkg/gameserverallocations/controller_test.go:911:18: string `remotecluster` has 3 occurrences, make it a constant (goconst)
		clusterName := "remotecluster"

you could also write //nolint: goconst if you wish to skip this

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0b4ffcfd-dd70-4864-aaac-41d0fd598d9f

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/GoogleCloudPlatform/agones.git pull/830/head:pr_830 && git checkout pr_830
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=0.11.0-70fec74

// If there is a server error try a different endpoint
continue
}
if response.StatusCode >= 400 {
Copy link
Member

Choose a reason for hiding this comment

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

Curious - why stop at a 400, why not continue to the next endpoint like a 500?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

4xx means there is an error from client. We only retry with new endpoint if there is an error from server e.g. 5xx.

Copy link
Member

Choose a reason for hiding this comment

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

My concern would be, that if after I set everything up, and all is well - if something weird happens to one of my clusters, such that they return a 404, that could potentially stop all/a large chunk of multicluster allocations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

404 means the client is asking gameserverallocation for a resource that is not available. It is a client error and should be handled by client. If a cluster is out of gameservers to allocate, then it returns 500. Does it make sense?

Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah totally 👍 I'm just thinking through worst case scenarios.

Like someone accidentally puts a different service in place of where the allocator used to be setup 😨

Not incredibly likely, but just thinking through it.

@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones labels Jun 17, 2019
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 5f9fffce-ded5-4e94-a9d8-5c5a506181b0

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

pkg/gameserverallocations/controller.go Outdated Show resolved Hide resolved
// If there is a server error try a different endpoint
continue
}
if response.StatusCode >= 400 {
Copy link
Member

Choose a reason for hiding this comment

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

My concern would be, that if after I set everything up, and all is well - if something weird happens to one of my clusters, such that they return a 404, that could potentially stop all/a large chunk of multicluster allocations.

pkg/gameserverallocations/controller.go Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 64423a31-2aa7-4fa8-9c11-82b00cfd3229

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 297945a0-f14a-4588-bf5d-6c1cd566e03d

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/GoogleCloudPlatform/agones.git pull/830/head:pr_830 && git checkout pr_830
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=0.11.0-e440301

Copy link
Contributor

@ilkercelikyilmaz ilkercelikyilmaz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

LGTM!

@markmandel markmandel merged commit f7d5997 into googleforgames:master Jun 17, 2019
@markmandel markmandel added this to the 0.11.0 milestone Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants