Skip to content

fix(rust): auto-reconnect on transport errors after server restart#2880

Open
spetz wants to merge 3 commits intomasterfrom
fix_rust_sdk_reconnection
Open

fix(rust): auto-reconnect on transport errors after server restart#2880
spetz wants to merge 3 commits intomasterfrom
fix_rust_sdk_reconnection

Conversation

@spetz
Copy link
Contributor

@spetz spetz commented Mar 5, 2026

The SDK's send_raw_with_response() only triggered reconnect for a
subset of errors (Disconnected, EmptyResponse, Unauthenticated,
StaleClient). Transport-specific write errors like TcpError,
ConnectionClosed, WebSocketSendError, and QuicError were not in
the list, causing producers and consumers to loop forever on a
dead connection instead of reconnecting.

Added all transport-specific errors to the reconnect match in
TCP, WebSocket, and QUIC clients. TLS connections use the same
error types and code path, so they are also covered.

Integration tests verify both producer and consumer reconnect
across all three stateful transports (TCP, WebSocket, QUIC).

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.50%. Comparing base (33bee3d) to head (2709ad8).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2880      +/-   ##
============================================
+ Coverage     68.33%   68.50%   +0.16%     
  Complexity      739      739              
============================================
  Files          1053     1053              
  Lines         84763    84763              
  Branches      61297    61307      +10     
============================================
+ Hits          57923    58065     +142     
+ Misses        24468    24312     -156     
- Partials       2372     2386      +14     
Flag Coverage Δ
csharp 67.43% <ø> (-0.19%) ⬇️
go 6.27% <ø> (ø)
java 54.83% <ø> (ø)
node 92.26% <ø> (-0.04%) ⬇️
python 81.57% <ø> (ø)
rust 70.27% <ø> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/sdk/src/quic/quic_client.rs 72.96% <ø> (+1.75%) ⬆️
core/sdk/src/tcp/tcp_client.rs 72.84% <ø> (+0.73%) ⬆️
core/sdk/src/websocket/websocket_client.rs 71.77% <ø> (+10.76%) ⬆️

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spetz spetz force-pushed the fix_rust_sdk_reconnection branch from 861a948 to f0201e8 Compare March 5, 2026 18:57
@spetz spetz added sdk Change related to sdk (client) API rust Pull requests that update Rust code labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code sdk Change related to sdk (client) API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants