Skip to content

Commit

Permalink
Reconnect standalone connection on unrecoverable errors. (valkey-io#1076
Browse files Browse the repository at this point in the history
)

These errors represent any situation in which the connection has reached a state in which it is no longer usable.
  • Loading branch information
nihohit authored Mar 5, 2024
1 parent 30d8654 commit fb93d1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glide-core/src/client/standalone_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}`"),
Expand Down

0 comments on commit fb93d1a

Please sign in to comment.