From e84b33c034f274aa9f37114910051ccb81ca65bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Hofman?= Date: Mon, 29 Apr 2024 17:54:34 +0200 Subject: [PATCH] SNOW-937188 review fixes --- Snowflake.Data/Core/Session/SessionPool.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Snowflake.Data/Core/Session/SessionPool.cs b/Snowflake.Data/Core/Session/SessionPool.cs index 5495bb562..e2322c7d8 100644 --- a/Snowflake.Data/Core/Session/SessionPool.cs +++ b/Snowflake.Data/Core/Session/SessionPool.cs @@ -414,10 +414,13 @@ internal bool AddSession(SFSession session, bool ensureMinPoolSize) return false; } - if (session.SessionPropertiesChanged && _poolConfig.ChangedSession == ChangedSessionBehavior.Destroy) + if (IsMultiplePoolsVersion() && + session.SessionPropertiesChanged && + _poolConfig.ChangedSession == ChangedSessionBehavior.Destroy + ) { session.SetPooling(false); - Task.Run(() => session.CloseAsync(CancellationToken.None)).ConfigureAwait(false); + // Task.Run(() => session.CloseAsync(CancellationToken.None)).ConfigureAwait(false); ReleaseBusySession(session); ScheduleNewIdleSessions(ConnectionString, Password, RegisterSessionCreationsWhenReturningSessionToPool()); return false;