DXP - System.ComponentModel.Win32Exception (258) or Timeout period elapsed prior to obtaining a connection from the pool


Here's a simple KQL query you can run in AI Logs to summarize exceptions from the Azure SQL calls:

| where target contains ".database.windows.net"
| where tostring(customDimensions.Exception) !contains "Violation of"
| summarize sum(itemCount) by substring(tostring(customDimensions.Exception),0,275)
| order by sum_itemCount desc
| project sum_itemCount, Column1

Looking into stability issues and when problems arise we see large amounts of these:

  1. Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (258): Unknown error 258
  2. Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

I'm interested if others are also seeing these two exceptions in some volume for their CMS 12 on DXP?

Here's an issue for SqlClient that suggests this may be a broader issue with dotnet core running in Linux containers in general:
For the DXP this suggests some tweaks are already in place:

Aug 21, 2023 7:24

A shot in the dark but maybe this is with MARS enabled? When I was testing performance for CMS 12 MARS does not work well on Linux

Aug 22, 2023 14:00
Johan Kronberg - Aug 22, 2023 14:37
I got some info on that too; checked with operations and they set the connectionstring without the parameter in it (which should mean False).
We got better stability upgrading SqlClient to 5.1.1 (from 5.0.1 in our case). We are also now testing upgrade to .NET 7 from 6 on Integration to see if that gives us some improvements.
Quan Mai - Aug 22, 2023 14:53
interesting, keep us posted please
Johan Kronberg - Sep 11, 2023 17:54
Unfortunately we have logged occurrences of both exceptions also after going to .NET 7 in production.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.