-
Notifications
You must be signed in to change notification settings - Fork 588
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
Size Constraints #405
Size Constraints #405
Conversation
I vastly prefer this approach to the others. 👍 |
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 everybody will prefer the simplicity of this kind of statement but i think we ended up going down the other rabbit-holes because we thought more specificity was needed.
Whatever we do i think it'd help to have a compliance test, maybe leveraging our SDKs, that can be used to assert the 64K boundary condition.
spec.md
Outdated
encoding for an event used by the application SHOULD be considered for | ||
compliance with this size constraint. | ||
|
||
A consumer or intermediaries MAY refuse to accept events that exceed an |
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/intermediaries/intermediary/
spec.md
Outdated
of events, because the referenced external data items allow for differentiated | ||
access control to sensitive details. | ||
|
||
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This |
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.
Can we re-word this more along the lines of _"... CloudEvent intermediaries MUST be capable of transporting and delivering CloudEvents with a wire-size of 64 KByte.." - we're not looking to limit the size and i believe SHOULD NOT is a bit of a strong statement.
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.
A personal note first: I am sorry that the following dismissal sounds rather harsh. I have invested significant amount of time in trying to build a consensus in the workgroup, also based on feedback from Clemens. I think I have made it clear that I'm willing to compromise on virtually anything, except for a guarantee of interoperability for event producers. #395 is based on the feedback of the workgroup over several months and has significantly changed compared to my original PR.
I wish we could have resolved this in the previous workgroup meetings, and I am also more than willing to take back my PR if Clemens proposal would guarantee interoperabilty.
This proposal does not ensure interoperability between different encodings and transport formats: An event producer may not know which encodings and transports will be used for their events, and they may not implement those.
This proposal is simpler to implement for those that want to limit the wire-size to exactly 64KB. The only middleware that qualifies is Azure EventGrid. Every other tech stack we looked at (see #257) has higher limits (e.g. 256KB or 1MB).
Additionally, this proposal goes against a previous decision by the workgroup against a size constraint.
spec.md
Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute. | |||
* Constraints: | |||
* OPTIONAL | |||
|
|||
# Size Constraints |
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.
As I have pointed out on last weeks call, the workgroup already discussed whether we should have a size constraint, or a size guarantee. On Jan 17, the workgroup decided that we want to go with a size guarantee, and not with a constraint.
If you don't tryst my comments in the PR, feel free to listen to the recording of the call.
One of the reasons is that 64 KB is the lowest common denominator due to Azure EventGrid. All other tech stacks we looked at supported higher wire sizes, and members of the workgroup still want to use larger events if they know their tech stack supports it without violating a SHOULD.
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.
Perhaps Minimum Supported Size
or CloudEvent Size
?
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.
# Size Constraints | |
# Size Guarantee |
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.
The suggestion above is still valid.
spec.md
Outdated
If an application configuration requires for events to be routed across different | ||
transports or for events to be re-encoded, the least efficient transport and | ||
encoding for an event used by the application SHOULD be considered for | ||
compliance with this size constraint. |
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.
Practically, if the least efficient transport
is:
- JSON, the event producer is exactly in the same scenario as in Encoding & Transport Independent Interoperability Guarantee (JSON-based Size Measurement) #364
- something else, the event producer SHOULD know the size in that transport/encoding.
The first case was not acceptable to you, and you have requested that #364 is changed to not force event producers to serialize events to JSON if they are using a different encoding. I am wondering what suddenly changed your mind?
The second case is significantly worse for the event producer. JSON must be implemented, so the event producer can easily measure the size. For anything else, there is no guarantee the event producer has it implemented.
My main motivation for this whole effort is to enable event producers that will be part of a huge number of applications and tech stacks (examples: GitHub, PayPal, Twilio, ...) to be confident their events will be accepted by any event consumer, independently of what is used on the wire. This proposal does not achieve it.
Please see: https://lists.cncf.io/g/cncf-cloudevents/topic/vote_how_to_deal_with_sizes/30703703?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,30703703 |
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.
nits
spec.md
Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute. | |||
* Constraints: | |||
* OPTIONAL | |||
|
|||
# Size Constraints |
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.
Perhaps Minimum Supported Size
or CloudEvent Size
?
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute. | |||
* Constraints: | |||
* OPTIONAL | |||
|
|||
# Size Constraints | |||
|
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.
It might be nice to start with the requirements in a compact/clear declaration followed by the explainer text. Seek time is high as written.
Perhaps
The size of an event is its wire-size. Wire-size includes every bit that is transmitted on the wire: transport frame-metadata, event metadata, and event data.
* Consumers MUST accept events up to 64KM in size.
* Consumers MAY reject any event over 64KB in size.
Perhaps MUST
should be SHOULD
to allow for compliant low memory footprint consumers but my expectation is that such circumstances would be fairly narrow and would reduce the value of this section.
spec.md
Outdated
|
||
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This | ||
includes the frame-metadata of the chosen transport and all event metadata and | ||
event data, regardless of encoding. |
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.
nit: s/the frame-metadata of the chosen transport and all event metadata and event data/the frame-metadata of the chosen transport, all event metadata, and event data/
rebase needed |
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.
As discussed
spec.md
Outdated
of events, because the referenced external data items allow for differentiated | ||
access control to sensitive details. | ||
|
||
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This |
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.
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This | |
CloudEvent intermediaries MUST be capable of transporting and delivering CloudEvents with a wire-size of 64 KByte. |
(Jems suggestion)
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This | |
All CloudEvent consumers SHOULD accept events with an overall wire-size of 64 KByte. |
Sounds similar to my PR.
spec.md
Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute. | |||
* Constraints: | |||
* OPTIONAL | |||
|
|||
# Size Constraints |
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.
# Size Constraints | |
# Size Guarantee |
a1f7de4
to
24ab19b
Compare
@clemensv rebase needed, and I think you were going to make some editoral tweaks. |
I think the rebase did some funky stuff -for example, the new version number is reverted and the new "required attributes" header section is gone. |
ping @clemensv to check the rebase - see the previous comment |
Ignoring the rebase needed, and just focusing on the text in the "Size Constraints" section - this LGTM and is aligned with what the group agreed to in a previous call. |
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.
@duglin Asked me to make my usual comments for the third time, because on last weeks call, multiple people found the constraint-enforcement (or kinda-enforcement via SHOULD) odd.
As discussed previously, these issues don't arise if we focus on a size guarantee from intermediaries.
spec.md
Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute. | |||
* Constraints: | |||
* OPTIONAL | |||
|
|||
# Size Constraints |
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.
The suggestion above is still valid.
spec.md
Outdated
transport and encoding used by the application SHOULD be considered for | ||
compliance with these size constraints: | ||
|
||
- Publishers SHOULD NOT publish events exceeding a size of 64 KByte. |
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.
This line should be removed.
@clemensv rebase needed and there are some outstanding questions from @cneijenhuis |
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
740be10
to
fc7b84e
Compare
I redid the commit because I messed up that branch. To address @cneijenhuis' comments, I now call the section "Size Limits" (I find "Guarantees" too strong) and I also removed the statement about the Publisher as suggested. What's left is that intermediaries MUST forward 64KB and that consumers SHOULD be able to deal with 64KB. |
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 appreciate the intent of introducing a distinction between intermediaries and consumers here. It seems that you are introducing a new dimension that could and perhaps should impact the whole specification. Doing so in the scope of this PR rather than as a separate and comprehensive PR doesn't seem like the right approach. Otherwise, I offer a few nits and point out language where it doesn't appear you've written what you intend.
spec.md
Outdated
transport and encoding used by the application SHOULD be considered for | ||
compliance with these size constraints: | ||
|
||
- Intermediaries MUST forward events of a size of at least 64 KByte. |
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.
Although I believe I understand your intent, this technically only creates a requirement for events of "at least 64 KByte" or in other words, events with a size that is 64KB or more. As such, as written it doesn't discuss events of the smaller size but worse, it specifies that all events 64KB or larger MUST be forwarded by intermediaries.
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.
@erikerikson can you suggest some alternate wording?
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.
My original recommendation was offered in a previous [comment] (#405 (comment)) but new framing has been developed which is good. I'll attempt to make a suggestion in the next few days.
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.
.... of a size of 64 KBytes or less.
spec.md
Outdated
embedded devices, that are storage or memory-constrained and therefore | ||
would struggle with large singular events. | ||
|
||
The "size of an event" is it's wire-size, and includes every bit that is |
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.
NIT: I believe size
is the term here. I think only that should be quoted.
spec.md
Outdated
- Intermediaries MUST forward events of a size of at least 64 KByte. | ||
- Consumers SHOULD accept events of a size of at least 64 KByte. | ||
|
||
In effect, these rules will allow events of up to 64 KByte to be published |
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.
Consider In effect, these rules will allow producers to publish events up to 64KB in size safely. Safely here means that it is generally reasonable to expect the event to be accepted and retransmitted by all intermediaries.
|
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
Approved on the 6/6 call with the minor wording change in the latest commit ( b723e49 ). |
This is an alternate proposal for #395 and #364 which states a simple 64 KByte "should" wire-size limit for publishers and for consumers along with guidance to refer to large data items instead of including them,
Signed-off-by: Clemens Vasters clemensv@microsoft.com