Skip to content

Commit

Permalink
SNOW-984600 Avoid closing sessions synchronously with obtained lock
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed Dec 11, 2023
1 parent 3710031 commit 3def3c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Snowflake.Data/Core/Session/SessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ private void CleanExpiredSessions()
{
if (item.IsExpired(_timeout, timeNow))
{
Task.Run(() => item.close());

Check warning on line 60 in Snowflake.Data/Core/Session/SessionPool.cs

View check run for this annotation

Codecov / codecov/patch

Snowflake.Data/Core/Session/SessionPool.cs#L60

Added line #L60 was not covered by tests
_sessions.Remove(item);
item.close();
}
}
}
Expand Down Expand Up @@ -96,7 +96,7 @@ private SFSession GetIdleSession(string connStr)
long timeNow = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
if (session.IsExpired(_timeout, timeNow))
{
session.close();
Task.Run(() => session.close());
i--;
}
else
Expand Down Expand Up @@ -187,7 +187,7 @@ internal void ClearAllPools()
{
foreach (SFSession session in _sessions)
{
session.close();
Task.Run(() => session.close());
}
_sessions.Clear();
}
Expand Down

0 comments on commit 3def3c3

Please sign in to comment.