You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// connection creation failed on semaphore waiting or if max pool reached
161
-
if(connectionPool.IsRunning)
162
-
{
163
-
SqlClientEventSource.Log.TryTraceEvent("<prov.DbConnectionFactory.GetConnection|RES|CPOOL> {0}, GetConnection failed because a pool timeout occurred.",ObjectID);
164
-
// If GetConnection failed while the pool is running, the pool timeout occurred.
165
-
throwADP.PooledOpenTimeout();
166
-
}
167
-
else
168
-
{
169
-
// We've hit the race condition, where the pool was shut down after we got it from the group.
170
-
// Yield time slice to allow shut down activities to complete and a new, running pool to be instantiated
timeBetweenRetriesMilliseconds*=2;// double the wait time for next iteration
174
-
}
175
-
}
176
-
}
177
-
}while(connection==null&&retriesLeft-->0);
178
-
179
-
if(connection==null)
180
-
{
181
-
SqlClientEventSource.Log.TryTraceEvent("<prov.DbConnectionFactory.GetConnection|RES|CPOOL> {0}, GetConnection failed because a pool timeout occurred and all retries were exhausted.",ObjectID);
// connection creation failed on semaphore waiting or if max pool reached
317
+
if(connectionPool.IsRunning)
318
+
{
319
+
SqlClientEventSource.Log.TryTraceEvent("<prov.SqlConnectionFactory.GetConnection|RES|CPOOL> {0}, GetConnection failed because a pool timeout occurred.",ObjectId);
320
+
// If GetConnection failed while the pool is running, the pool timeout occurred.
321
+
throwADP.PooledOpenTimeout();
322
+
}
323
+
324
+
// We've hit the race condition, where the pool was shut down after we
325
+
// got it from the group. Yield time slice to allow shutdown activities
326
+
// to complete and a new, running pool to be instantiated before
327
+
// retrying.
328
+
Thread.Sleep(timeBetweenRetriesMilliseconds);
329
+
timeBetweenRetriesMilliseconds*=2;// double the wait time for next iteration
330
+
}
331
+
}
332
+
}while(connection==null&&retriesLeft-->0);
333
+
334
+
if(connection==null)
335
+
{
336
+
SqlClientEventSource.Log.TryTraceEvent("<prov.SqlConnectionFactory.GetConnection|RES|CPOOL> {0}, GetConnection failed because a pool timeout occurred and all retries were exhausted.",ObjectId);
0 commit comments