snowflakedb / snowflake-connector-python

Snowflake Connector for Python
https://pypi.python.org/pypi/snowflake-connector-python/
Apache License 2.0
568 stars 456 forks source link

SNOW-1468259 Add connection timeout and read timeout to storage client request #1988

Open sfc-gh-stan opened 1 week ago

sfc-gh-stan commented 1 week ago

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1468259

  2. Fill out the following pre-review checklist:

    • [ ] I am adding a new automated test(s) to verify correctness of my new code
    • [ ] I am adding new logging messages
    • [ ] I am adding a new telemetry message
    • [ ] I am modifying authorization mechanisms
    • [ ] I am adding new credentials
    • [ ] I am modifying OCSP code
    • [ ] I am adding a new dependency
  3. Please describe how your code solves the related issue.

    By default, request do not time out unless a timeout value is set explicitly. A user recently reported that their file transfer would sometimes hang indefinitely at reading from a request call. This PR aims to mitigate this issue by specifying a default connection timeout of 10 seconds and socket read timeout of 10 minutes. Please see https://requests.readthedocs.io/en/latest/user/advanced/#timeouts