Skip to content

Commit 44e552b

Browse files
userFRMclaude
andauthored
feat(streaming)!: trim reconnect_jitter to full/none; drop equal + decorrelated (#1197)
* feat(streaming)!: trim reconnect_jitter to full/none; drop equal + decorrelated The reconnect backoff exposed four AWS jitter modes — Full, Equal, Decorrelated, None. Full jitter (sample uniformly from [0, delay]) is the right default for a recovering fleet and stays; None (deterministic) is kept for tests. Equal and Decorrelated were unused academic variants with no operational benefit over full jitter — flexibility nobody sets — so they are removed. The JitterMode enum drops both variants (its sampler no longer needs the per-burst BackoffSchedule, so the now-dead decorrelated walk state — the schedule's `prev` field and `reset()` — is removed too), and the C-ABI integer encoding collapses to 0 = Full, 1 = None. Removed across every binding, the config surface, the cross-binding parity rows, and the docs; setting the removed modes (or the old C-ABI codes 1 = Equal / 2 = Decorrelated) is now rejected with the typed invalid-parameter error. Breaking change to the configuration surface. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test(cpp): update reconnect_jitter round-trip to the 2-mode encoding The C++ error-taxonomy test set reconnect_jitter(2) (the removed Decorrelated code) as its valid non-default value; use 1 (None) now that the encoding is 0=Full, 1=None. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: preview <noreply@anthropic.com>
1 parent 6881c03 commit 44e552b

19 files changed

Lines changed: 50 additions & 178 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- **`host_selection` / `host_shuffle_seed` streaming host-ordering knobs.** Removed from every binding (Rust `StreamingConfig::host_selection` / `host_shuffle_seed`, Python `Config.streaming_host_selection` / `streaming_host_shuffle_seed`, TypeScript `Config.streamingHostSelection` / `setStreamingHostSelection` and the shuffle-seed pair, C++ `set_streaming_host_selection` / `get_streaming_host_selection` and the shuffle-seed pair, C ABI `thetadatadx_config_*_streaming_host_selection` / `_host_shuffle_seed`), along with the `HostSelectionPolicy` enum. The client now cycles the declared host list left to right — the terminal's own behavior — and a reconnect tries the last-known-good host first. The per-client fault-domain shuffle and its seed existed only in the SDK, with no terminal counterpart. This is a breaking change to the configuration surface.
1515

16+
- **`reconnect_jitter` trimmed to `"full"` / `"none"`.** The `"equal"` and `"decorrelated"` jitter variants are removed from every binding (the `JitterMode` enum drops them, and the C-ABI integer encoding is now `0 = Full`, `1 = None`). Full jitter — sampling uniformly from `[0, delay]` — stays the default and is the right choice for a recovering fleet; `"none"` (deterministic delays) remains for tests. The two removed variants were unused academic backoff modes with no operational benefit over full jitter. Setting `reconnect_jitter` to `"equal"` or `"decorrelated"` (or the C-ABI codes `1` / `2`) is now rejected. This is a breaking change to the configuration surface.
17+
1618
## [0.1.1] - 2026-07-07
1719

1820
### Added

docs-site/docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- **`host_selection` / `host_shuffle_seed` streaming host-ordering knobs.** Removed from every binding (Rust `StreamingConfig::host_selection` / `host_shuffle_seed`, Python `Config.streaming_host_selection` / `streaming_host_shuffle_seed`, TypeScript `Config.streamingHostSelection` / `setStreamingHostSelection` and the shuffle-seed pair, C++ `set_streaming_host_selection` / `get_streaming_host_selection` and the shuffle-seed pair, C ABI `thetadatadx_config_*_streaming_host_selection` / `_host_shuffle_seed`), along with the `HostSelectionPolicy` enum. The client now cycles the declared host list left to right — the terminal's own behavior — and a reconnect tries the last-known-good host first. The per-client fault-domain shuffle and its seed existed only in the SDK, with no terminal counterpart. This is a breaking change to the configuration surface.
1515

16+
- **`reconnect_jitter` trimmed to `"full"` / `"none"`.** The `"equal"` and `"decorrelated"` jitter variants are removed from every binding (the `JitterMode` enum drops them, and the C-ABI integer encoding is now `0 = Full`, `1 = None`). Full jitter — sampling uniformly from `[0, delay]` — stays the default and is the right choice for a recovering fleet; `"none"` (deterministic delays) remains for tests. The two removed variants were unused academic backoff modes with no operational benefit over full jitter. Setting `reconnect_jitter` to `"equal"` or `"decorrelated"` (or the C-ABI codes `1` / `2`) is now rejected. This is a breaking change to the configuration surface.
17+
1618
## [0.1.1] - 2026-07-07
1719

1820
### Added

docs-site/docs/streaming/reliability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ All on the [configuration object](/articles/configuration), prefixed `reconnect_
2727
|---|---|---|
2828
| `reconnect_policy` | `"auto"` | `"auto"` recovers automatically; `"manual"` never reconnects (you call `reconnect()`); `"custom"` uses your callback. |
2929
| `reconnect_wait_ms` / `reconnect_wait_max_ms` | 250 / 30000 | Exponential backoff ladder: initial delay and cap. |
30-
| `reconnect_jitter` | `"full"` | Jitter mode: `"full"`, `"equal"`, `"decorrelated"`, `"none"`. |
30+
| `reconnect_jitter` | `"full"` | Jitter mode: `"full"`, `"none"`. |
3131
| `reconnect_max_attempts` | 30 | Attempt budget for transient drops. |
3232
| `reconnect_max_elapsed_secs` | 300 | Wall-clock cap on one recovery sequence; `0` disables. |
3333
| `reconnect_wait_rate_limited_ms` / `reconnect_max_rate_limited_attempts` | 130000 / 100 | Floor and budget for rate-limited drops. |

parity.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,7 @@ cpp = true
19601960
[method.signature]
19611961
returns = "String"
19621962
cpp_returns = "i32"
1963-
python_pyi_returns = 'Literal["full", "equal", "decorrelated", "none"]'
1963+
python_pyi_returns = 'Literal["full", "none"]'
19641964

19651965
# Custom reconnect-policy callback registration. A field-shaped getter
19661966
# is meaningless for a callback, so the registration is tracked as a

thetadatadx-cpp/include/config_accessors.hpp.inc

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

thetadatadx-cpp/include/thetadatadx.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,11 +1378,9 @@ int32_t thetadatadx_config_get_reconnect_wait_server_restart_ms(const ThetaDataD
13781378
/**
13791379
* Set the jitter strategy applied to every reconnect delay.
13801380
* mode=0: Full (default) -- sample uniformly from [0, delay].
1381-
* mode=1: Equal -- delay/2 + uniform(0, delay/2).
1382-
* mode=2: Decorrelated -- walk relative to the previous delay.
1383-
* mode=3: None -- deterministic delays (tests only).
1381+
* mode=1: None -- deterministic delays (tests only).
13841382
* @param config Config handle to mutate.
1385-
* @param mode Jitter strategy selector (0-3 per the list above).
1383+
* @param mode Jitter strategy selector (0 = Full, 1 = None).
13861384
* @return 0 on success, -1 on an invalid mode or null config.
13871385
*/
13881386
int32_t thetadatadx_config_set_reconnect_jitter(ThetaDataDxConfig* config, int32_t mode);

thetadatadx-cpp/tests/error_taxonomy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ TEST_CASE("config enum setters reject an out-of-domain value with InvalidParamet
208208
// throw.
209209
auto cfg = thetadatadx::Config::production();
210210

211-
REQUIRE_NOTHROW(cfg.set_reconnect_jitter(2));
211+
REQUIRE_NOTHROW(cfg.set_reconnect_jitter(1));
212212
REQUIRE_THROWS_AS(cfg.set_reconnect_jitter(9), thetadatadx::InvalidParameterError);
213213

214214
}

thetadatadx-ffi/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ mod resilience_knob_tests {
21152115
0
21162116
);
21172117
assert_eq!(mode, 0, "default jitter mode is Full");
2118-
for m in [1, 2, 3, 0] {
2118+
for m in [1, 0] {
21192119
assert_eq!(super::thetadatadx_config_set_reconnect_jitter(cfg, m), 0);
21202120
assert_eq!(
21212121
super::thetadatadx_config_get_reconnect_jitter(cfg, &mut mode),

thetadatadx-ffi/src/config_accessors.rs

Lines changed: 6 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

thetadatadx-py/python/thetadatadx/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ class Config:
225225
"""Back-off floor, in milliseconds, applied to the rate-limited (TooManyRequests) failure class (default 130_000)."""
226226
reconnect_wait_server_restart_ms: int
227227
"""Flat reconnect cadence, in milliseconds, applied to the ServerRestarting failure class (default 5_000)."""
228-
reconnect_jitter: Literal["full", "equal", "decorrelated", "none"]
229-
"""Jitter strategy applied to every reconnect delay: ``"full"`` (default), ``"equal"``, ``"decorrelated"``, or ``"none"``."""
228+
reconnect_jitter: Literal["full", "none"]
229+
"""Jitter strategy applied to every reconnect delay: ``"full"`` (default) or ``"none"``."""
230230
reconnect_replay_burst_size: int
231231
"""Number of subscription-replay frames sent per burst after an auto-reconnect (default 50, minimum 1)."""
232232
reconnect_replay_pace_ms: int

0 commit comments

Comments
 (0)