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

Add clarity around concurrent updates #300

Merged
merged 2 commits into from
Oct 16, 2017

Conversation

duglin
Copy link
Contributor

@duglin duglin commented Aug 29, 2017

From the f2f:
Proposal: In the “Blocking Operations” section change it to say “...that mutate the same resource…” instead of “...that act on the same set of resources...”

&& creating Binding is not necessary considered mutating an Instance, it’s a Broker’s choice

&& move “Blocking Operations” out from under Async

&& change 422 in createBinding response status code table to include this concurrency stuff

Signed-off-by: Doug Davis dug@us.ibm.com

@cfdreddbot
Copy link

Hey duglin!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@angarg12
Copy link
Contributor

angarg12 commented Aug 29, 2017

LGTM

Approved with PullApprove

@jmrodri
Copy link

jmrodri commented Aug 30, 2017

@duglin PR title has a TYPO: conurrent should be concurrent

@duglin duglin changed the title Add clarity around conurrent updates Add clarity around concurrent updates Aug 30, 2017
@duglin
Copy link
Contributor Author

duglin commented Aug 30, 2017

@jmrodri fixed! thanks

@avade
Copy link
Contributor

avade commented Sep 4, 2017

LGTM

Approved with PullApprove

1 similar comment
@mattmcneeney
Copy link
Contributor

mattmcneeney commented Sep 5, 2017

LGTM

Approved with PullApprove

@duglin
Copy link
Contributor Author

duglin commented Sep 5, 2017

just one more review needed

@jmrodri
Copy link

jmrodri commented Sep 5, 2017

Not sure I count but LGTM :)

@duglin
Copy link
Contributor Author

duglin commented Sep 10, 2017

Added text about orphan mitigation per the weekly meeting.

@duglin
Copy link
Contributor Author

duglin commented Sep 10, 2017

I changed the error code from 422 to "409 Conflict" - seemed more appropriate, but what do others think?

@jmrodri
Copy link

jmrodri commented Sep 11, 2017

@duglin 409 Conflict does sound more appropriate. 👍

@angarg12
Copy link
Contributor

angarg12 commented Sep 11, 2017

LGTM

Approved with PullApprove

@duglin
Copy link
Contributor Author

duglin commented Sep 12, 2017

reviews needed

spec.md Outdated
@@ -782,7 +789,7 @@ $ curl http://username:password@broker-url/v2/service_instances/:instance_id/ser
| 201 Created | MUST be returned if the binding was created as a result of this request. The expected response body is below. |
| 400 Bad Request | MUST be returned if the request is malformed or missing mandatory data. |
| 409 Conflict | MUST be returned if a service binding with the same id, for the same service instance, already exists but with different parameters. The expected response body is `{}`, though the description field MAY be used to return a user-facing error message, as described in [Broker Errors](#broker-errors). |
| 422 Unprocessable Entity | MUST be returned if the broker requires that `app_guid` be included in the request body. The expected response body is: `{ "error": "RequiresApp", "description": "This service supports generation of credentials through binding an application only." }`. |
| 422 Unprocessable Entity | MUST be returned if the broker requires that `app_guid` be included in the request body. The expected response body is: `{ "error": "RequiresApp", "description": "This service supports generation of credentials through binding an application only." }`. Additionally, if the broker rejects the request due to a concurrent request to create a binding for the same service instance, then this error MUST be returned (see [Blocking Operations](#blocking-operations)). |
Copy link
Contributor

Choose a reason for hiding this comment

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

Above, we return 409 conflict when there are concurrent operations ongoing, but here we do 422 which seems a bit inconsistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

damn - I'll fix that later today

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@duglin
Copy link
Contributor Author

duglin commented Sep 18, 2017

updated and ready for reviews

@mattmcneeney
Copy link
Contributor

mattmcneeney commented Sep 18, 2017

LGTM

Approved with PullApprove

1 similar comment
@angarg12
Copy link
Contributor

angarg12 commented Sep 18, 2017

LGTM

Approved with PullApprove

spec.md Outdated
this error response SHOULD resend the request at a later time.

Brokers MAY choose to treat the creation of a binding as a mutation of
the corresponding service instance - it is an implementation choice.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add text about how this might cause platforms to serialize binding create() requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@duglin
Copy link
Contributor Author

duglin commented Sep 25, 2017

ready for next round of reviews

@mattmcneeney
Copy link
Contributor

mattmcneeney commented Sep 26, 2017

LGTM

Approved with PullApprove

@fmui
Copy link
Member

fmui commented Sep 26, 2017

The proposal defines a fixed error body. A broker can neither change the description nor add additional data that might be useful to identify why there is a conflict. Can we make this a bit more flexible?

@duglin
Copy link
Contributor Author

duglin commented Sep 26, 2017

@fmui See: https://github.com/duglin/servicebroker/blob/6cbba3d423f3d7e5ebadd2e650f245ce531e1e2f/spec.md#broker-errors it says: "For error responses, the following fields are valid. Others will be ignored. ". While it would be nice if it was a bit clearer, I view that as saying the broker may include other fields (extensions) but they might be ignored by the platform. Does that cover it?

@fmui
Copy link
Member

fmui commented Sep 26, 2017

Not really. The proposal says:
"...then the broker MUST reject the request with an HTTP 409 Conflict and the following body: ..."

This is much more restrictive than defined in the Broker Error section. It doesn't even allow to return a different description text. I don't see a reason why this error should have stricter rules than other errors.

@duglin
Copy link
Contributor Author

duglin commented Sep 26, 2017

I don't think it was meant to be more restrictive. I think an generic "error PR" to make us more consistent would be good to answer these concerns. In particular:

  • which fields in the error json MUST be as exactly specified or can be tweaked (e.g description)
  • are additional fields (extensions) allowed and how are they added? (wrapper or top-level)

and we should touch all error text to ensure consistency.

@vaikas
Copy link
Contributor

vaikas commented Sep 26, 2017

+1 to allowing for additional fields. We have already run into some issues because brokers are built on platforms that provide some fixed fields for all error responses.

@duglin
Copy link
Contributor Author

duglin commented Sep 26, 2017

@fmui can we clarify all of this in a follow-on PR? I'd prefer to keep this one more focused on just this one usecase.

@zrob
Copy link
Member

zrob commented Sep 26, 2017

I have a few concerns here.

  1. changing the MUST from 422 to 409 is a backwards incompatible change
  2. similar to fmui concern, this feels like a very restrictive error message, where brokers may want to include more or different details that could be helpful in resolving the issue
  3. I don't understand the benefits of making this change. I can see that 409 may be somewhat more correct, but do we have platforms that will perform a different behavior based on this? As long as we are returning an error and a useful message I don't see a reason to be more prescriptive than we already are.

@duglin
Copy link
Contributor Author

duglin commented Oct 3, 2017

I reverted back to 422 and decided to add the "extensibility" text into this PR instead of creating a new one. See what people think.

@mattmcneeney
Copy link
Contributor

@duglin merge conflict!

Doug Davis added 2 commits October 10, 2017 07:40
From the f2f:
Proposal: In the “Blocking Operations” section change it to say “...that mutate the same resource…” instead of “...that act on the same set of resources...”

&& creating Binding is not necessary considered mutating an Instance, it’s a Broker’s choice

&& move “Blocking Operations” out from under Async

&& change 422 in createBinding response status code table to include this concurrency stuff

Signed-off-by: Doug Davis <dug@us.ibm.com>
Signed-off-by: Doug Davis <dug@us.ibm.com>
@duglin
Copy link
Contributor Author

duglin commented Oct 10, 2017

rebased

@mattmcneeney
Copy link
Contributor

mattmcneeney commented Oct 10, 2017

This is going to give me merge conflict fun times in the async bindings PR. But LGTM anyway!

Approved with PullApprove

@angarg12
Copy link
Contributor

angarg12 commented Oct 10, 2017

LGTM

Approved with PullApprove

1 similar comment
@fmui
Copy link
Member

fmui commented Oct 10, 2017

LGTM

Approved with PullApprove

@avade
Copy link
Contributor

avade commented Oct 16, 2017

lgtm

Approved with PullApprove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants