Description
Add handling of oversized-message. choreographer should transparently split CDP payloads that exceed Chrome's 100 MiB pipe buffer.
Why should this change be made?
This feature was added to Kaleido in plotly/Kaleido#442, but it had the unintended consequence of breaking serialization. This was due to the fact that the payload had to be measured before sending it to determine the size. The naive serialization (using orjson instead of PlotlyJSONEncoder) broke on a number of data structures. At any rate, chunking belongs where serialization and the wire already live.
Scope
- Add payload size check to choreographer during serialization
- If the size is greater than the limit (~100MiB), chunk the payload
- If the payload can't be chunked, raise an error
- If the size is under the limit, handle the call normally
Notes
Description
Add handling of oversized-message. choreographer should transparently split CDP payloads that exceed Chrome's 100 MiB pipe buffer.
Why should this change be made?
This feature was added to Kaleido in plotly/Kaleido#442, but it had the unintended consequence of breaking serialization. This was due to the fact that the payload had to be measured before sending it to determine the size. The naive serialization (using
orjsoninstead ofPlotlyJSONEncoder) broke on a number of data structures. At any rate, chunking belongs where serialization and the wire already live.Scope
Notes
kReceiveBufferSizeForDevToolsis a hardcoded100 * 1024 * 1024join('').