Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Oct 9, 2024
1 parent 3fd8428 commit dbb41ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions redis/src/aio/multiplexed_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,9 @@ where
})
.await
.map_err(|err| {
// If an error occurs here, it means the request never reached the server.
// Since the server did not receive the data, it is safe to retry the request.
// If an error occurs here, it means the request never reached the server, as guaranteed
// by the 'send' function. Since the server did not receive the data, it is safe to retry
// the request.
RedisError::from((
crate::ErrorKind::IoErrorRetrySafe,
"Failed to send the request to the server",
Expand All @@ -384,6 +385,7 @@ where
// The `sender` was dropped which likely means that the stream part
// failed for one reason or another.
// Since we don't know if the server received the request, retrying it isn't safe.
// For example, retrying an INCR request could result in double increments.
// Hence, we return an IoError instead of an IoErrorRetrySafe.
Err(RedisError::from(io::Error::from(io::ErrorKind::BrokenPipe)))
}
Expand Down

0 comments on commit dbb41ff

Please sign in to comment.