Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nector-net into SNOW-878067-Retry-Strategy
  • Loading branch information
sfc-gh-ext-simba-lf committed Oct 26, 2023
2 parents b7dc6bd + 9237a3d commit 59f1f7e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Snowflake.Data/Core/Session/SessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ internal SessionPool()

~SessionPool()
{
ClearAllPools();
// Use async for the finalizer due to possible deadlock
// when waiting for the CloseResponse task while closing the session
ClearAllPoolsAsync();
}

public void Dispose()
Expand Down Expand Up @@ -191,6 +193,16 @@ internal void ClearAllPools()
}
}

internal async void ClearAllPoolsAsync()
{
s_logger.Debug("SessionPool::ClearAllPoolsAsync");
foreach (SFSession session in _sessionPool)

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 199 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name '_sessionPool' does not exist in the current context
{
await session.CloseAsync(CancellationToken.None).ConfigureAwait(false);
}
_sessionPool.Clear();

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name '_sessionPool' does not exist in the current context

Check failure on line 203 in Snowflake.Data/Core/Session/SessionPool.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name '_sessionPool' does not exist in the current context
}

public void SetMaxPoolSize(int size)
{
_maxPoolSize = size;
Expand Down

0 comments on commit 59f1f7e

Please sign in to comment.