Skip to content

Commit 91d68eb

Browse files
sfc-gh-yuwangsfc-gh-aling
authored andcommitted
SNOW-1708720: Error is raised at debug level when not closing connection (#2090)
1 parent 524e19f commit 91d68eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/snowflake/connector/aio/_network.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,11 @@ async def _request_exec(
815815
RuntimeError,
816816
AttributeError, # json decoding error
817817
) as err:
818+
if isinstance(err, RuntimeError) and "Event loop is closed" in str(err):
819+
logger.info(
820+
"If you see the logging error message 'RuntimeError: Event loop is closed' during program exit, it probably indicates that the connection was not closed properly before the event loop was shut down. Please use SnowflakeConnection.close() to close connection."
821+
)
822+
raise err
818823
if is_login_request(full_url):
819824
logger.debug(
820825
"Hit a timeout error while logging in. Will be handled by "

0 commit comments

Comments
 (0)