Skip to content

Commit d8935da

Browse files
committed
SNOW-1720699: fix network implementation and add unit test (#2071)
1 parent b6e0a38 commit d8935da

File tree

3 files changed

+565
-16
lines changed

3 files changed

+565
-16
lines changed

src/snowflake/connector/aio/_network.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -656,22 +656,8 @@ async def _request_exec_wrapper(
656656

657657
reason = getattr(cause, "errno", 0)
658658
retry_ctx.retry_reason = reason
659-
660-
if "Connection aborted" in repr(e) and "ECONNRESET" in repr(e):
661-
# connection is reset by the server, the underlying connection is broken and can not be reused
662-
# we need a new urllib3 http(s) connection in this case.
663-
# We need to first close the old one so that urllib3 pool manager can create a new connection
664-
# for new requests
665-
try:
666-
logger.debug(
667-
"shutting down requests session adapter due to connection aborted"
668-
)
669-
session.get_adapter(full_url).close()
670-
except Exception as close_adapter_exc:
671-
logger.debug(
672-
"Ignored error caused by closing https connection failure: %s",
673-
close_adapter_exc,
674-
)
659+
# notes: in sync implementation we check ECONNRESET in error message and close low level urllib session
660+
# we do not have the logic here because aiohttp handles low level connection close-reopen for us
675661
return None # retry
676662
except Exception as e:
677663
if not no_retry:

0 commit comments

Comments
 (0)