diff --git a/sqlx-postgres/src/listener.rs b/sqlx-postgres/src/listener.rs index e09f4c5203..242823688f 100644 --- a/sqlx-postgres/src/listener.rs +++ b/sqlx-postgres/src/listener.rs @@ -262,7 +262,10 @@ impl PgListener { // The connection is dead, ensure that it is dropped, // update self state, and loop to try again. - Err(Error::Io(err)) if err.kind() == io::ErrorKind::ConnectionAborted => { + Err(Error::Io(err)) + if (err.kind() == io::ErrorKind::ConnectionAborted + || err.kind() == io::ErrorKind::UnexpectedEof) => + { self.buffer_tx = self.connection().await?.stream.notifications.take(); self.connection = None;