fix(client): invalidate TX correlation after send failures
This commit is contained in:
6 files changed
+66
-9
No files matched your search
@@ -167,9 +167,9 @@ impl Client {
|
||||
/// unrelated datagrams are ignored until the current attempt's absolute
|
||||
/// deadline, so one attempt may consume several datagrams without
|
||||
/// retransmitting. Silence or ignored traffic eventually produces
|
||||
/// [`ClientError::OpenTimeout`]. A malformed or incompatible reply that is
|
||||
/// recognized as coming from the connected peer is terminal; when HMAC is
|
||||
/// configured, that recognition additionally requires authentication.
|
||||
/// [`ClientError::OpenTimeout`]. A structurally recognizable malformed or
|
||||
/// incompatible Open reply from the connected peer is terminal; when HMAC
|
||||
/// is configured, that recognition additionally requires authentication.
|
||||
///
|
||||
/// When a trusted reply allocates a token but later negotiation or socket
|
||||
/// preparation fails, the client sends a best-effort cleanup close and
|
||||
@@ -524,11 +524,18 @@ impl Client {
|
||||
.unwrap_or_else(Instant::now);
|
||||
#[cfg(test)]
|
||||
if fail_send {
|
||||
runtime.invalidate_kernel_tx_correlation();
|
||||
return Err(ClientError::Socket(io::Error::other(
|
||||
"injected probe send failure",
|
||||
)));
|
||||
}
|
||||
let bytes = socket.send(&prepared.bytes)?;
|
||||
let bytes = match socket.send(&prepared.bytes) {
|
||||
Ok(bytes) => bytes,
|
||||
Err(error) => {
|
||||
runtime.invalidate_kernel_tx_correlation();
|
||||
return Err(ClientError::Socket(error));
|
||||
}
|
||||
};
|
||||
#[cfg(not(test))]
|
||||
let send_finished_at = Instant::now();
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user