From: Aaron Schulz Date: Wed, 5 Oct 2016 22:02:59 +0000 (-0700) Subject: Add more information to reuseConnection() exceptions X-Git-Tag: 1.31.0-rc.0~5195^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=d1d5d00267c1a8212534e2856364696771ec877c;p=lhc%2Fweb%2Fwiklou.git Add more information to reuseConnection() exceptions Change-Id: Id2e6b275c8dc074fde460424178a2bc54f303d65 --- diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 9f1021d3c5..66e4fcf3d9 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -615,9 +615,12 @@ class LoadBalancer implements ILoadBalancer { } $domain = $conn->getDomainID(); - if ( $this->mConns['foreignUsed'][$serverIndex][$domain] !== $conn ) { + if ( !isset( $this->mConns['foreignUsed'][$serverIndex][$domain] ) ) { throw new InvalidArgumentException( __METHOD__ . - ": connection not found, has the connection been freed already?" ); + ": connection $serverIndex/$domain not found; it may have already been freed." ); + } elseif ( $this->mConns['foreignUsed'][$serverIndex][$domain] !== $conn ) { + throw new InvalidArgumentException( __METHOD__ . + ": connection $serverIndex/$domain mismatched; it may have already been freed." ); } $conn->setLBInfo( 'foreignPoolRefCount', --$refCount ); if ( $refCount <= 0 ) {