From fb93d1aa985ab52c4861bd1a0ced4c3bcf2c5e00 Mon Sep 17 00:00:00 2001 From: Shachar Langbeheim Date: Tue, 5 Mar 2024 14:05:59 +0200 Subject: [PATCH] Reconnect standalone connection on unrecoverable errors. (#1076) These errors represent any situation in which the connection has reached a state in which it is no longer usable. --- glide-core/src/client/standalone_client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glide-core/src/client/standalone_client.rs b/glide-core/src/client/standalone_client.rs index 8889102315..f2a337e07d 100644 --- a/glide-core/src/client/standalone_client.rs +++ b/glide-core/src/client/standalone_client.rs @@ -225,7 +225,7 @@ impl StandaloneClient { let mut connection = reconnecting_connection.get_connection().await?; let result = connection.send_packed_command(cmd).await; match result { - Err(err) if err.is_connection_dropped() => { + Err(err) if err.is_unrecoverable_error() => { log_warn("send request", format!("received disconnect error `{err}`")); reconnecting_connection.reconnect(); Err(err) @@ -321,7 +321,7 @@ impl StandaloneClient { .send_packed_commands(pipeline, offset, count) .await; match result { - Err(err) if err.is_connection_dropped() => { + Err(err) if err.is_unrecoverable_error() => { log_warn( "pipeline request", format!("received disconnect error `{err}`"),