Index: src/wp-includes/wp-db.php
===================================================================
--- src/wp-includes/wp-db.php	(revision 27915)
+++ src/wp-includes/wp-db.php	(working copy)
@@ -1386,9 +1386,13 @@
 	 *
 	 * @since 3.9.0
 	 *
+	 * @param bool $allow_bail Optional. Allows the function to bail, default true. If this is set
+	 *                         to false, you will need to handle the lack of database connection
+	 *                         manually.
+	 *
 	 * @return bool True if the connection is up.
 	 */
-	function check_connection() {
+	function check_connection( $allow_bail = true ) {
 		if ( $this->use_mysqli ) {
 			if ( @mysqli_ping( $this->dbh ) ) {
 				return true;
@@ -1431,6 +1435,10 @@
 			return false;
 		}
 
+		if ( ! $allow_bail ) {
+			return false;
+		}
+
 		// We weren't able to reconnect, so we better bail.
 		$this->bail( sprintf( ( "
 <h1>Error reconnecting to the database</h1>
