raise the datastream WebSocket message size limit (SCH-7098) - #110
Merged
Conversation
websockets.connect() was left on the library's 1 MiB max_size default, so a Flags payload from a large environment closes the connection with a 1009 and the client reconnects into the same frame forever. Pass an explicit 100 MiB limit, matching the Node SDK's `ws` default, and make it overridable. Also stop clearing the reconnect backoff on the handshake alone: a failure that always lands after connecting kept restarting at the ~1s floor instead of escalating to the 30s cap. The backoff now clears once the connection delivers a message or stays up 30 seconds.
bpapillon
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
websockets.connect()never passedmax_size, so the datastream client kept the library's 1 MiB default. Syrto'srulesengine.Flagsframe is 1,125,653 bytes, so the library closes the connection with a 1009 and the client reconnects straight into the same frame — ~1,000 reconnects an hour since they crossed 1 MiB on 2026-09-04. Flag checks stay correct becausecheck_flag_with_entitlementfalls back to REST, but the datastream never delivers anything. Python is the only SDK affected: schematic-node inheritsws's 100 MiBmaxPayloadand the Go replicator never callsSetReadLimit.Pass an explicit 100 MiB
max_sizeto match Node, exposed asmax_message_sizeonClientOptions,DataStreamClientOptionsandDataStreamConfig.Second change in the same file:
_reconnect_attemptswas cleared on every successful handshake, so a failure that always lands after connecting never escalated past the ~1s backoff floor. It now clears once the connection delivers a message or stays up 30 seconds. Consequence worth a look in review — a permanently poisoned connection now exhaustsmax_reconnect_attemptsand fireson_errorinstead of churning forever.Not addressed here: 740 rules already yields a 1.1 MB frame and Airia prod is ~10x that, so a client cap is not a durable answer.
EnableCompressionon the datastream upgrader in schematic-api would cut this payload ~10x — worth its own ticket.