jenkins-bot has submitted this change and it was merged.

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


Add DBConnRef sanity check to LoadBalancer::reuseConnection()

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

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index c030cb2..bda185a 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -597,6 +597,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;
                }
 
                $domain = $conn->getDomainID();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b079b994f29c5f7953efe73982ef9e6946a21f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to