rust-sdk/crates/rmcp/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
ump45nose 46db531df9
fix(sse): saturate exponential reconnect backoff to avoid overflow panic (#1231)
* fix(sse): saturate exponential reconnect backoff

ExponentialBackoff::retry computed the reconnect multiplier with
2u32.pow(current_times). With max_times unset, current_times can reach
the bit width, panicking in debug builds and wrapping to a zero delay in
release builds for long-lived SSE clients. Use saturating_pow and
Duration::saturating_mul so the delay stays monotonic and panic-free.

* fix(sse): cap exponential reconnect backoff at a bounded max delay

Saturating the multiplier alone can still yield decades-long sleeps once
current_times reaches the bit width, pinning the stream in
tokio::time::sleep without reconnecting or terminating. Add an optional
max_delay (default 30s) that clamps the computed delay, keeping the
backoff monotonic and panic-free while guaranteeing the client retries.

* fix(sse): default max_delay to None to preserve unbounded backoff

Per maintainer feedback, leave ExponentialBackoff::default() unbounded so
the fix stays a pure overflow bug-fix. The saturating multiplier removes
the debug panic / release wrap from #1198, while max_delay stays opt-in
for callers that want a bounded reconnect delay.
2026-09-09 21:24:29 -04:00
..
handler feat: add ServerHandler::negotiate_initialize (#1247) 2026-09-08 19:05:04 -04:00
model feat: add request-state key rotation (#1128) 2026-08-28 22:19:23 +09:00
service feat: add ServerHandler::negotiate_initialize (#1247) 2026-09-08 19:05:04 -04:00
transport fix(sse): saturate exponential reconnect backoff to avoid overflow panic (#1231) 2026-09-09 21:24:29 -04:00
error.rs refactor!: remove deprecated v3 APIs (#1066) 2026-07-28 14:01:56 -04:00
handler.rs fix: remove unnecessary doc-cfg (#661) 2026-02-17 10:07:40 -05:00
lib.rs refactor!: remove deprecated v3 APIs (#1066) 2026-07-28 14:01:56 -04:00
model.rs feat: add ServerHandler::negotiate_initialize (#1247) 2026-09-08 19:05:04 -04:00
service.rs fix: keep initialize on legacy protocol versions (#1228) 2026-09-01 07:38:57 +09:00
task_manager.rs feat: route SEP-2260 associated server requests to the originating SSE stream (#1029) 2026-07-23 13:12:20 -04:00
transport.rs feat(auth): coordinate OAuth refreshes through credential stores (#1232) 2026-08-31 16:59:37 -04:00