Compare commits

...

2 Commits

Author SHA1 Message Date
Pratik Mankawde
6884543e21 Merge branch 'develop' into pratik/fix-wsclient-unhandled-exception-on-close 2026-03-26 12:22:14 +00:00
Pratik Mankawde
704764eb31 fix: Handle WSClient write failure when server closes WebSocket (RIPD-5573)
Use the error_code overload of write_some in WSClientImpl::invoke()
to gracefully handle the case where the server has already closed the
WebSocket connection (e.g. after booting a client that exceeded
resource thresholds). This prevents an unhandled "Operation canceled"
exception that intermittently fails xrpl.rpc.RPCOverload in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 12:16:32 +00:00

View File

@@ -184,7 +184,14 @@ public:
jp[jss::command] = cmd;
}
auto const s = to_string(jp);
ws_.write_some(true, buffer(s));
// Use the error_code overload to avoid an unhandled exception
// when the server closes the WebSocket connection (e.g. after
// booting a client that exceeded resource thresholds).
error_code ec;
ws_.write_some(true, buffer(s), ec);
if (ec)
return {};
}
auto jv =