-
Notifications
You must be signed in to change notification settings - Fork 434
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
Conversation
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. |
@duglin PR title has a TYPO: conurrent should be concurrent |
@jmrodri fixed! thanks |
1 similar comment
just one more review needed |
Not sure I count but LGTM :) |
7774d8d
to
d925a0d
Compare
Added text about orphan mitigation per the weekly meeting. |
d925a0d
to
ba0e50f
Compare
I changed the error code from 422 to "409 Conflict" - seemed more appropriate, but what do others think? |
@duglin |
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)). | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ba0e50f
to
e5b6da2
Compare
updated and ready for reviews |
1 similar comment
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
e5b6da2
to
6cbba3d
Compare
ready for next round of reviews |
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? |
@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? |
Not really. The proposal says: 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. |
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:
and we should touch all error text to ensure consistency. |
+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. |
@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. |
I have a few concerns here.
|
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. |
@duglin merge conflict! |
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 <[email protected]>
Signed-off-by: Doug Davis <[email protected]>
rebased |
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 [email protected]