diff --git a/Snowflake.Data/Core/Session/SessionPool.cs b/Snowflake.Data/Core/Session/SessionPool.cs index a54304930..530df1b5f 100644 --- a/Snowflake.Data/Core/Session/SessionPool.cs +++ b/Snowflake.Data/Core/Session/SessionPool.cs @@ -218,11 +218,11 @@ internal void ClearAllPools() internal async void ClearAllPoolsAsync() { s_logger.Debug("SessionPool::ClearAllPoolsAsync"); - foreach (SFSession session in _sessions) + foreach (SFSession session in _idleSessions) { await session.CloseAsync(CancellationToken.None).ConfigureAwait(false); } - _sessions.Clear(); + _idleSessions.Clear(); } public void SetMaxPoolSize(int size)