snowflakedb / snowflakedb/snowflake-connector-python

SNOW-1632317: connector does not retry in certain cases where connector receives None response from the server

Open
#2,030 1 comment 0 reactions 1 assignee View on GitHub

@sfc-gh-aling is already working on this.

Since Aug 26, 2024.

bug status-triage_done
Dominant language
Python
Stars
730
Forks
574
Avg merge
5h 45m
Merged PRs (30d)
16

Description

Python version

any

Operating system and processor architecture

any

Installed packages
snowflake-connector-python
What did you do?
server sometimes send back http response with None, leading to the connector raises UnknownError, this could happen at any http requests
What did you expect to see?

retry upon None without any side effect

Can you set logging to DEBUG and collect the logs?
import logging
import os

for logger_name in ('snowflake.connector',):
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
    logger.addHandler(ch)
more context

in the PR SNOW-1562604: enhance error handling when polling query result by sfc-gh-aling · Pull Request #2027 · snowflakedb/snowflake-connector-python we enhanced retry on handling 499 error (client receiving None response) when polling long running query result.

there are more get/post requests in the connector which need similar enhancement, but they also need more tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.