Modified:
branches/5.0/CHANGES
branches/5.0/Driver/Source/MySqlPool.cs
branches/5.0/TestSuite/Source/PoolingTests.cs
Log:
Fixed problem where an attempt to open a connection max pool size times while the server
is down will prevent any further attempts due to the pool semaphore being full. (Bug
#29409)
Modified: branches/5.0/CHANGES
===================================================================
--- branches/5.0/CHANGES 2007-07-23 22:25:17 UTC (rev 803)
+++ branches/5.0/CHANGES 2007-07-24 00:02:22 UTC (rev 804)
@@ -30,6 +30,9 @@
- Fixed problem where MySqlConnection.BeginTransaction checked the drivers
status var before checking if the connection was open. The result was that the
driver could report an invalid condition on a previously opened connection.
+ - Fixed problem where an attempt to open a connection max pool size times while
+ the server is down will prevent any further attempts due to the pool semaphore
+ being full. (Bug #29409)
Version 5.0.7 5/16/2007
Modified: branches/5.0/Driver/Source/MySqlPool.cs
===================================================================
--- branches/5.0/Driver/Source/MySqlPool.cs 2007-07-23 22:25:17 UTC (rev 803)
+++ branches/5.0/Driver/Source/MySqlPool.cs 2007-07-24 00:02:22 UTC (rev 804)
@@ -149,7 +149,8 @@
// if we don't have an idle connection but we have room for a new
// one, then create it here.
if (!HasIdleConnections)
- CreateNewPooledConnection();
+ if (!CreateNewPooledConnection())
+ return null;
Driver d = CheckoutConnection();
if (d != null)
@@ -160,11 +161,20 @@
/// <summary>
/// It is assumed that this method is only called from inside an active lock.
/// </summary>
- private void CreateNewPooledConnection()
+ private bool CreateNewPooledConnection()
{
- Driver driver = Driver.Create(settings);
- idlePool.Enqueue(driver);
- }
+ Driver driver = null;
+ try
+ {
+ driver = Driver.Create(settings);
+ }
+ catch (Exception)
+ {
+ return false;
+ }
+ idlePool.Enqueue(driver);
+ return true;
+ }
public void ReleaseConnection(Driver driver)
{
@@ -218,7 +228,10 @@
// or room to make a new connection
lock (lockObject)
{
- return GetPooledConnection();
+ Driver d = GetPooledConnection();
+ if (d == null)
+ poolGate.Release();
+ return d;
}
}
}
Modified: branches/5.0/TestSuite/Source/PoolingTests.cs
===================================================================
--- branches/5.0/TestSuite/Source/PoolingTests.cs 2007-07-23 22:25:17 UTC (rev 803)
+++ branches/5.0/TestSuite/Source/PoolingTests.cs 2007-07-24 00:02:22 UTC (rev 804)
@@ -257,6 +257,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
| Thread |
|---|
| • Connector/NET commit: r804 - in branches/5.0: . Driver/Source TestSuite/Source | rburnett | 24 Jul |