Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For failed connection requests in ConnectionPool in case of PoolBlock… #1768

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ namespace Microsoft.Data.ProviderBase
{
sealed internal partial class DbConnectionPool
{
partial void CheckPoolBlockingPeriod(Exception e)
{
if (!IsBlockingPeriodEnabled())
{
throw e;
}
}

private bool IsBlockingPeriodEnabled()
{
var poolGroupConnectionOptions = _connectionPoolGroup.ConnectionOptions as SqlConnectionString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,12 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio
throw;
}

CheckPoolBlockingPeriod(e);
#if NETCOREAPP
if (!IsBlockingPeriodEnabled())
{
throw;
}
#endif

// Close associated Parser if connection already established.
if (newObj?.IsConnectionAlive() == true)
Expand Down Expand Up @@ -824,9 +829,6 @@ private DbConnectionInternal CreateObject(DbConnection owningObject, DbConnectio
return newObj;
}

//This method is implemented in DbConnectionPool.NetCoreApp
partial void CheckPoolBlockingPeriod(Exception e);

private void DeactivateObject(DbConnectionInternal obj)
{
SqlClientEventSource.Log.TryPoolerTraceEvent("<prov.DbConnectionPool.DeactivateObject|RES|CPOOL> {0}, Connection {1}, Deactivating.", ObjectID, obj.ObjectID);
Expand Down