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
Hi!
If connection fails, the connection pool getting exhausted (even I use FbConnection.ClearAllPools()). Issue exists on 7.10.x.x but not in 7.5.0.0.
Example code:
**************************************************************
int retries = 0;
while (true)
{
try
{
using (var con = new FbConnection($"User=SYSDBA;Password=xxxxx;Database=db;DataSource=localhost;Port=3553;Dialect=3;Charset=NONE;MaxPoolSize=3"))
{
con.Open();
}
}
catch (Exception ex)
{
Console.WriteLine($"Connection failed: {ex.Message}");
if (!(ex is FbException)) break;
FbConnection.ClearAllPools();
if (retries++ >= 4)
{
Console.WriteLine("Giving up....");
break;
}
}
\}
***********************************************************
With 7.5.0.0 the output is like expected:
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Giving up....
With 7.10.x.x the output is:
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Connection pool is full.
Additionally,
I stepped into FbConnectionPoolManager source code and if I use FbConnection.ClearAllPools(), FbConnectionPoolManager internal variable Stack<Item> _available is cleared but
variable List<FbConnectionInternal> _busy is not cleared.
Submitted by: Silver Aid (silveraid)
Hi!
If connection fails, the connection pool getting exhausted (even I use FbConnection.ClearAllPools()). Issue exists on 7.10.x.x but not in 7.5.0.0.
Example code:
**************************************************************
int retries = 0;
while (true)
{
try
{
using (var con = new FbConnection($"User=SYSDBA;Password=xxxxx;Database=db;DataSource=localhost;Port=3553;Dialect=3;Charset=NONE;MaxPoolSize=3"))
{
con.Open();
}
}
catch (Exception ex)
{
Console.WriteLine($"Connection failed: {ex.Message}");
if (!(ex is FbException)) break;
FbConnection.ClearAllPools();
if (retries++ >= 4)
{
Console.WriteLine("Giving up....");
break;
}
}
***********************************************************
With 7.5.0.0 the output is like expected:
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Giving up....
With 7.10.x.x the output is:
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Unable to complete network request to host "localhost".
Connection failed: Connection pool is full.
Thanks in advance.
Silver
Commits: 2290ec0
The text was updated successfully, but these errors were encountered: