diff --git a/libs/postgres_backend/src/lib.rs b/libs/postgres_backend/src/lib.rs index f6bf7c6fc2..453c58431a 100644 --- a/libs/postgres_backend/src/lib.rs +++ b/libs/postgres_backend/src/lib.rs @@ -50,11 +50,14 @@ impl QueryError { } } +/// Returns true if the given error is a normal consequence of a network issue, +/// or the client closing the connection. These errors can happen during normal +/// operations, and don't indicate a bug in our code. pub fn is_expected_io_error(e: &io::Error) -> bool { use io::ErrorKind::*; matches!( e.kind(), - ConnectionRefused | ConnectionAborted | ConnectionReset | TimedOut + BrokenPipe | ConnectionRefused | ConnectionAborted | ConnectionReset | TimedOut ) }