You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(streaming): harden FPSS subscription tracking, ring defaults, and credential validation (#809)
* fix(streaming): harden FPSS subscription tracking, ring defaults, and credential validation
Oversized streaming credentials now return a typed invalid-parameter configuration error before the connection opens instead of panicking. The credentials payload builder validates the total length against the 255-byte frame limit up front and names both the limit and the actual size; every connect and auth call site propagates the result.
Active subscriptions are de-duplicated by contract and by full-stream security type, so a repeated subscribe no longer accumulates duplicate tracked entries that replay multiple times on reconnect. Unsubscribe keeps its remove-once semantics. The command channel to the I/O worker is now bounded: the heartbeat takes natural backpressure with a blocking send and the public subscribe and unsubscribe methods return a typed queue-full error rather than dropping commands or growing the queue without limit.
The direct streaming builder now defaults its buffer to the production streaming buffer size, so a builder-constructed client gets production-grade headroom for large streams by default; callers can still set a smaller size explicitly. The streaming backpressure documentation is corrected to state that newly arriving events are dropped when the buffer is full, not the oldest buffered events.
Closes#803Closes#804Closes#805
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(bench): consume the now-fallible build_credentials_payload result
build_credentials_payload returns Result since it validates the
credential lengths against the wire frame bounds, so discarding its
value trips unused-must-use under -D warnings on the benches target.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
58
58
### Changed
59
59
60
60
- The `tdbe` time-and-calendar crate is folded into `thetadatadx` as a private internal module, so the workspace builds and publishes a single `thetadatadx` artifact. The curated public surface is unchanged (`TradeTick`, `greeks::all_greeks`, `SecType`, `utils::conditions`, and the calendar types are reached at `thetadatadx::*` paths); items that were previously foreign-public — `PriceError`, `MAX_PRICE_TYPE`, `greeks::Error` — are re-exported at public crate paths, and the data-layer internals (DST epoch math, canonical-JSON helpers, the FIT / FIE codecs) stay behind the existing `__internal` feature.
61
+
- The direct `StreamingClientBuilder` now defaults its streaming buffer to the same size as the production streaming configuration, so a builder-constructed client gets production-grade overflow headroom by default for large streams (10k-15k option contracts plus full trade streams) instead of a much smaller buffer that drops events under market bursts; set `.ring_size(..)` to choose a smaller footprint. The streaming backpressure documentation is also corrected to state that newly arriving events are dropped when the buffer is full, not the oldest buffered events.
61
62
62
63
### Fixed
63
64
@@ -70,6 +71,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
70
71
- Python — the standalone `StreamingClient` streaming connect, reconnect, and subscribe / unsubscribe paths release the GIL across their blocking I/O (the TLS connect and handshake, and the per-subscription wire write), so other Python threads keep running while a connect or subscribe is in flight; the typed exception raised on failure is unchanged.
71
72
- The standalone Python and TypeScript streaming clients now forward the full streaming and reconnect config, so every tuning knob — including the wait strategy and consumer-core affinity, host selection, watchdog and keepalive cadences, and the reconnect backoff and replay pacing — is honored, matching the unified client and the C ABI.
72
73
- The bundled WebSocket server acknowledges stream requests with ThetaData's stream-verification values: a successful subscribe, unsubscribe, or stop now returns `SUBSCRIBED` instead of `OK`, and a subscribe that arrives before streaming has started returns `ERROR` with a descriptive message instead of a false-positive `OK` that claimed success while installing nothing.
74
+
- Oversized streaming credentials now fail with a typed invalid-parameter configuration error before the connection is opened instead of panicking the caller. The credentials payload is validated against the 255-byte protocol frame limit up front, and the error names both the limit and the actual size so a too-long email or password is reported as a normal recoverable failure.
75
+
- Active streaming subscriptions are de-duplicated by contract and by full-stream security type, so a repeated subscribe no longer accumulates duplicate tracked entries that get replayed multiple times after a reconnect; unsubscribe still removes the tracked entry. The control channel that carries subscribe / unsubscribe / heartbeat commands to the I/O worker is now bounded, so a control-plane burst cannot grow it without limit: the heartbeat takes natural backpressure and the public subscribe / unsubscribe methods return a typed queue-full error rather than dropping a command or accumulating unbounded memory.
0 commit comments