Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312429

Change subject: Add DBConnRef sanity check to LoadBalancer::reuseConnection()
......................................................................

Add DBConnRef sanity check to LoadBalancer::reuseConnection()

Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
(cherry picked from commit c607b2e60fce8783655963b502bf03d098857165)
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/312429/1

diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index 791e5ad..eb72c29 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -596,6 +596,13 @@
                         * should be ignored
                         */
                        return;
+               } elseif ( $conn instanceof DBConnRef ) {
+                       // DBConnRef already handles calling reuseConnection() 
and only passes the live
+                       // Database instance to this method. Any caller passing 
in a DBConnRef is broken.
+                       $this->connLogger->error( __METHOD__ . ": got DBConnRef 
instance.\n" .
+                               ( new RuntimeException() )->getTraceAsString() 
);
+
+                       return;
                }
 
                $dbName = $conn->getDBname();

-- 
To view, visit https://gerrit.wikimedia.org/r/312429
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to