-
Notifications
You must be signed in to change notification settings - Fork 593
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 Prefer: reply
Header to subscriber request if spec.reply
is set
#5764
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5764 +/- ##
=======================================
Coverage 82.52% 82.52%
=======================================
Files 203 203
Lines 6374 6376 +2
=======================================
+ Hits 5260 5262 +2
Misses 768 768
Partials 346 346
Continue to review full report at Codecov.
|
@odacremolbap: changing LGTM is restricted to collaborators In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @lberk |
/hold, just for a bit. I'm not 100% sure that's what we want. The spec is ambiguous. |
Can you clarify the ambiguity in the spec? I'm happy to help clean it up; the goal was that a receiving function should be able to tell whether a reply event is going to be dropped on the floor or handled further by the infrastructure. Receiving functions aren't required to take advantage of this knowledge, but without offering that information it's hard for a programmer to defend (log, raise an alert) against message loss due to misconfiguration. |
@evankanderson it's not totally clear to me what From the spec:
I vaguely remember we talked about the filtering use case in the past, but I don't remember what was decided. I should go back to the spec PR. |
Sorry, I don't follow here. Do you mean the subscription's I might be missing context but this is what I expect from this feature: a sink developer can check the
The sink developer also needs to make sure that type, source and maybe other attributes are semantically valid, or at least append a The only thing I'm wondering about this PR: should the |
no. I mean the existence of the
This is not the primary use case for
The recipient cannot decide to not produce a reply event just because the sender does not support forwarding reply event.
That's not what it is suggested here. Leaving |
/hold |
I think the (valid) question is how should events delivered by a Subscription with an empty My gut is that we should always set the HTTP Header for
This should be an HTTP Header, not a cloudevent attribute, so it shouldn't be forwarded by Channels or Brokers. |
When I was looking at the issue and I was making the changes I put myself in the shoes of a developer who is consuming these requests. From that perspective, this change would help me to decide (and give me a hint) if I need to return a CloudEvent or not. I find that valuable and it follows the spec statements. I am not sure that it was the scope of this issue to review how replies should work. My two cents.. |
I'm with Mauricio, a Sink should have the chance to act different depending if a reply destination for the subscription involved in the communication is configured or not. @evankanderson are you suggesting that we send something like a |
@odacremolbap I also like that |
We probably want both.
@salaboy and @odacremolbap are proposing a new header, which, if I understand correctly, is about optimizing the event delivery by dropping reply events on the recipient side when
I agree.
Agree. How reply works is well-defined. It's just not safe without
Hint = optimization, meaning you can safely ignore it and no events will be silently dropped. If you ignore Moving forward:
|
Now yes we are on the same page, I completely overlooked the problem statement at the proposal doc. I don't have an strong opinion on whether the response when For the time being I'm in with what @lionelvillard suggests. |
I hadn't seen the optimization case, but I agree that at this time we can't use the lack of a Would it make sense to change the spec to require the header on all requests that will forward the reply, and then key |
To be clear, I'm fine with what y'all agree on, and will help clarify the spec to match, with this discussion as reference. |
For me that would be almost perfect, but I also understand that I am focusing on that optimization.
If that's the case, I get the impression that header with an empty value is an anti-pattern but taking a glimpse at RFCs I cannot find anything against it. Elaborating on the meaning of headers being received at sinks it would be:
|
@lionelvillard @evankanderson @odacremolbap to summarize, for this change we are only going to add the |
The following is the coverage report on the affected files.
|
I'm not 100% sure I understand what you mean by @odacremolbap I wonder if |
/approve |
@benmoss do you want to TAL, since you also put an hold on it. |
I was putting my hold on just because your hold failed 😄 /hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benmoss, gabo1208, lionelvillard, odacremolbap, salaboy 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 |
IIUC, this should be forwarded by brokers too, right? |
yes |
Thanks, then I'd expect this new header to be added here: eventing/pkg/broker/filter/filter_handler.go Lines 221 to 252 in 609741f
or allow the header to pass through the filter deployment: Lines 28 to 63 in 609741f
|
Also, this new feature is missing real E2E or conformance tests. |
@lionelvillard @pierDipi issue created: #5771 I need help labeling the issue, as I don't have enough permissions to do so |
Fixes #4127
Proposed Changes
🎁 Add new feature
This PR adds an additional header to the subscriber destination when a reply is specified, indicating the target service that a reply is preferred.
This doesn't forward the header to the reply request, it is only added to the destination indicated in the subscriber.
Pre-review Checklist
Release Note
Docs