Microsoft.Data.SqlClinet error connecting to Azure SQL Database - CheckPoolBlockingPeriod(System.Exception)

Barnes, James A 1 Reputation point
2022-05-02T13:25:26.93+00:00

I have a client application that connects to Azure SQL Database using AD Interactive login. It was working fine until last Friday - running the app would pop up a browser prompt for login, selecting the account would grant access appropriately. It was working fine for quite a while. Then something changed late last week and the app now throws an error when trying to connect to the database. No system patches or updates were applied to my local machine where the app is running during that time period. I confirmed that the last update applied was 4/15/2022 per Windows system settings. Seems CheckPoolBlockingPeriod is now broken? Here is the stack trace:

at Microsoft.Data.ProviderBase.DbConnectionPool.CheckPoolBlockingPeriod(Exception e)
at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at CsharpSqlServer.Program.Main(String[] args) in C:\Users\james.a.barnes\source\repos\dbTest\dbTest\Program.cs:line 65

Can anyone provide any insight into possible causes and workarounds? Again, the code has been running fine for a couple of months and the database connection code has not changed, so something else did. Thanks

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Barnes, James A 1 Reputation point
    2022-05-02T15:41:21.703+00:00

    I added ;Connection Timeout=60 to the connection string and that seems to have solved the issue