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

Change allocator gRPC response state to gRPC error status #1516

Merged
merged 2 commits into from May 6, 2020

Conversation

pooneh-m
Copy link
Collaborator

@pooneh-m pooneh-m commented May 6, 2020

What type of PR is this?
/kind breaking

What this PR does / Why we need it:
Allocator service gRPC API is changed to instead of returning response.status.state as allocated, unallocated or conflict return gRPC error status in case of failure and drop response.status.state API from the response.

Which issue(s) this PR fixes:
Closes #1040

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: bdcc5cce-43b3-479b-ba15-abef6dfa6ab5

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 9bca5d25-953f-4c09-91b4-6614fb575677

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 06073577-623a-4ac8-a3ff-6208eee7d2c3

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

cmd/allocator/main.go Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: f52c9289-3b77-4210-afa8-0de4295715f0

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/1516/head:pr_1516 && git checkout pr_1516
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-ad16cb0


func validateAllocatorResponse(t *testing.T, resp *pb.AllocationResponse) {
t.Helper()
assert.Greater(t, len(resp.Ports), 0)
Copy link
Collaborator

@aLekSer aLekSer May 6, 2020

Choose a reason for hiding this comment

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

Could assert.Equal(..., 1) or other specific value/func parameter be here?

Copy link
Collaborator Author

@pooneh-m pooneh-m May 6, 2020

Choose a reason for hiding this comment

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

Thanks. For this test >0 is enough for validation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, got it

@pooneh-m pooneh-m changed the title Change allocator gRPC response state to gRPC error status status Change allocator gRPC response state to gRPC error status May 6, 2020
@@ -183,13 +181,11 @@ func TestAllocatorCrossNamespace(t *testing.T) {
logrus.WithError(err).Info("failing Allocate request")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Line 173 above

   logrus.WithError(err).Info("failing http request")

Should be "failing grpc.Dial" as in other places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No this is actually failing the allocate request. grpc.Dial is successful at this point.

Copy link
Collaborator

@aLekSer aLekSer May 6, 2020

Choose a reason for hiding this comment

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

I mean not in this exact place but above. This is from master:

logrus.WithError(err).Info("failing http request")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

go.sum Outdated
@@ -290,6 +290,7 @@ google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4=
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am curious why go.mod was not changed?
It would still contain as in master?

	google.golang.org/grpc v1.20.1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm. I am not sure. I just did go mod tidy and it went away.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, now it is better.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 65144384-2549-48c1-b3ec-2af6f02d85e5

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/1516/head:pr_1516 && git checkout pr_1516
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-1e02dd9

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

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

Approving, PR looks good, no more requests from my side.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, pooneh-m

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pooneh-m
Copy link
Collaborator Author

pooneh-m commented May 6, 2020

Approving, PR looks good, no more requests from my side.

Thanks for your thorough review.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 020a35b8-d1c8-4af6-b55d-bd5409cee745

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/1516/head:pr_1516 && git checkout pr_1516
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-c510c0d

@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 2d78ed6c-687a-4a15-8d71-0ab6294b2717

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/1516/head:pr_1516 && git checkout pr_1516
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-e8972df

@markmandel markmandel merged commit ad4e127 into googleforgames:master May 6, 2020
@markmandel markmandel added kind/breaking Breaking change kind/feature New features for Agones labels May 6, 2020
@markmandel markmandel added this to the 1.6.0 milestone May 19, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved kind/breaking Breaking change kind/feature New features for Agones size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Allocator service to return 400+ http status for failure
5 participants