From 9146929575d027b57dfe2cbf38df5a80bc20bd57 Mon Sep 17 00:00:00 2001 From: Jakob Truelsen Date: Mon, 21 Dec 2020 20:47:32 +0100 Subject: [PATCH] Do not attempt to reconnect on every Io error. Io errors can describe a lot of things, when connecting to a database in general only ECONNREFUSED can be hoped to be resolved by waiting. Other errors will require user intervention --- sqlx-core/src/pool/inner.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlx-core/src/pool/inner.rs b/sqlx-core/src/pool/inner.rs index a595582b..7e911460 100644 --- a/sqlx-core/src/pool/inner.rs +++ b/sqlx-core/src/pool/inner.rs @@ -247,7 +247,7 @@ impl SharedPool { } // an IO error while connecting is assumed to be the system starting up - Ok(Err(Error::Io(_))) => Ok(None), + Ok(Err(Error::Io(e))) if e.kind() == std::io::ErrorKind::ConnectionRefused => Ok(None), // TODO: Handle other database "boot period"s