-
Notifications
You must be signed in to change notification settings - Fork 600
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 event reply header to spec #4560
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4560 +/- ##
==========================================
+ Coverage 81.02% 81.10% +0.08%
==========================================
Files 291 291
Lines 8221 8235 +14
==========================================
+ Hits 6661 6679 +18
+ Misses 1159 1156 -3
+ Partials 401 400 -1
Continue to review full report at Codecov.
|
/cc @vaikas |
@zhongduo @grantr @evankanderson based on today WG meeting I think we need to go back to the feature doc and/or create new one to evaluate alternatives/tradeoffs and raised issues? In particular how that header will work (or not)with what async group is proposing for indicating asynchronous reply (Prefer: async)? |
Copied from slack chat https://knative.slack.com/archives/C9JP909F0/p1607026424111100:
|
406a7a5
to
3039f75
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zhongduo 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 |
3039f75
to
cdc1d01
Compare
cdc1d01
to
018fd4b
Compare
/assign @vaikas |
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.
I understand why you would want this, but I think this is the wrong direction still. I would rather use a standard header rather than K-Eventing-Http-Attr
. If this header is used the likelyhood of this making its way outside of knative is near zero, meaning you can not make any of these requirements a MUST.
For this to get any traction, I think it needs to be brought up in the CloudEvents working group. The spec does not yet get into interop protocol contracts, but they might have some guidance from other standards. Likely they will say eventing should never reply but that is a tangent.
Looking at a standard header: https://tools.ietf.org/html/rfc7240
POST / HTTP/1.1
Host: /a/subscriber
Content-Type: application/json
Prefer: sink
Prefer: reply
I could see this working, but it will never be a MUST.
From a source:
POST / HTTP/1.1
Host: /a/subscriber
Content-Type: application/json
Prefer: sink
From a Broker:
POST / HTTP/1.1
Host: /a/subscriber
Content-Type: application/json
Prefer: consumer
Prefer: reply
From a channel sub.subscriber:
POST / HTTP/1.1
Host: /a/subscriber
Content-Type: application/json
Prefer: consumer
Prefer: reply
From a channel sub.reply:
POST / HTTP/1.1
Host: /a/subscriber
Content-Type: application/json
Prefer: consumer
Bikeshed on the prefer value set used...
docs/spec/data-plane.md
Outdated
|
||
An event sender, including Source and Broker and Channel, MUST include | ||
all the non-default HTTP attributes with header key `K-Eventing-Http-Attr` in | ||
every event delivery to specify |
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.
formatting is off
docs/spec/data-plane.md
Outdated
|
||
| Attributes | HTTP Feature Description | | ||
| ------------------ | ------------------------------------------------------------------------- | | ||
| `callable` | If the event sender supports event reply in HTTP response. | |
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.
Please run a markdown linting tool, table format is off
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.
Is there a linter I can use?
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.
prettier.io is what knobots use and I use locally
docs/spec/data-plane.md
Outdated
|
||
An example is that a broker supporting event reply MUST send events with | ||
an additional header `K-Eventing-Http-Attr: ["callable"]` so that the sink connected | ||
to the broker knows event replies will be accepted. While a source |
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.
s/broker
/Broker
/
But this is wrong, sinks and sources have no awareness of Broker, they only understand the data plane contract of their object refs or what they implement at the moment. If this was added, they would also understand what the caller is assuming the runtime contract is for the caller and this request.
This is an interesting point. I do remember that in one of the WG meetings, I was told that they found event reply a weird contract. But will we drop the support for event reply if they suggest so? |
This is what we are trying to avoid actually. The reasoning is that the number of brokers and channels are limited now AFAIK and I can add support to all of them. But adding such a requirement to all the custom sources is just impossible. What really matters is the default that the sink assumes without any additional header, as long as all the existing sources remain unchanged and the sink can assume event reply not supported, that should solve the problem. |
Changes after the discussion in the eventing WG meeting on 2021-01-13: 1) use standard prefer header as a hint to the sink whether event reply is supported, 2) no MUST for compatibility. @n3wscott WDYT? |
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.
I think this looks close for me. The last bikeshed thing is what the list of valid prefer values we think are valid. We have had feedback that "callable" is not well understood and we might want to think about breaking a full broker into two Prefers, like "sink" and "reply"
as I was showing in my last comment
I guess |
@n3wscott will it be a concern if later |
/lgtm |
@zhongduo Where are the docs that explain this for the user? |
This is one of the steps to solve #4127.
This is a follow up of the discussion in the event reply proposal to add the contract to the spec.
Proposed Changes
Release Note