async fn refresh_connection_pool(&self) -> core::result::Result<(), StorageError> {
        {
            let mut is_healthy_guard = self.is_healthy.write().await;
            if !*is_healthy_guard {
                info!("Already refreshing MySql connection pool!");
                return Ok(());
            }

            *is_healthy_guard = false;
        }
        warn!("Refreshing MySql connection pool.");
        debug!("BEGIN refresh mysql connection pool");

        // Grab early write lock so no new queries can be initiated before
        // connection pool is refreshed.
        let mut connection_pool_guard = self.pool.write().await;
        let pool = Self::new_connection_pool(&self.opts, &self.is_healthy).await?;
        *connection_pool_guard = pool;

        debug!("END refresh mysql connection pool");
        Ok(())
    }
// Occasionally our connection pool will become stale. This happens
// e.g on DB master promotions during mysql upgrades. In these scenarios our
// queries will begin to fail, and we will need to call this method to
// "refresh" the pool.
Occasionally our connection pool will become stale. This happens
e.g on DB master promotions during mysql upgrades. In these scenarios our
queries will begin to fail, and we will need to call this method to
"refresh" the pool.
Occasionally our connection pool will become stale . This happens e . g on DB master promotions during mysql upgrades . In these scenarios our queries will begin to fail and we will need to call this method to " refresh " the pool .
async fn refresh_connection_pool(&self) -> core::result::Result<(), StorageError> {
        {
            let mut is_healthy_guard = self.is_healthy.write().await;
            if !*is_healthy_guard {
                info!("Already refreshing MySql connection pool!");
                return Ok(());
            }
            *is_healthy_guard = false;
        }
        warn!("Refreshing MySql connection pool.");
        debug!("BEGIN refresh mysql connection pool");
        // Grab early write lock so no new queries can be initiated before
        // connection pool is refreshed.
        let mut connection_pool_guard = self.pool.write().await;
        let pool = Self::new_connection_pool(&self.opts, &self.is_healthy).await?;
        *connection_pool_guard = pool;
        debug!("END refresh mysql connection pool");
        Ok(())
    }
async fn refresh_connection_pool ( & self ) -> core :: result :: Result < ( ) , StorageError > { { let mut is_healthy_guard = self . is_healthy . write ( ) . await ; if ! * is_healthy_guard { info ! ( " " ) ; return Ok ( ( ) ) ; } * is_healthy_guard = false ; } warn ! ( " " ) ; debug ! ( " " ) ; // Grab early write lock so no new queries can be initiated before // connection pool is refreshed. let mut connection_pool_guard = self . pool . write ( ) . await ; let pool = Self :: new_connection_pool ( & self . opts , & self . is_healthy ) . await ? ; * connection_pool_guard = pool ; debug ! ( " " ) ; Ok ( ( ) ) }
Occasionally our connection pool will become stale.
Occasionally our connection pool will become stale .
&self
&self