Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Retry on connection timeout#103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -202,3 +202,6 @@ cython_debug/
databricks_sql_connector.egg-info/
dist/
build/

# vs code stuff
.vscode
34 changes: 17 additions & 17 deletionssrc/databricks/sql/thrift_backend.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -322,27 +322,27 @@ def attempt_request(attempt):
except OSError as err:
error = err
error_message = str(err)
# fmt: off
# The built-in errno package encapsulates OSError codes, which are OS-specific.
# log.info for errors we believe are not unusual or unexpected. log.warn for
# for others like EEXIST, EBADF, ERANGE which are not expected in this context.
#
# I manually tested this retry behaviour using mitmweb and confirmed that
# GetOperationStatus requests are retried when I forced network connection
# interruptions / timeouts / reconnects. See #24 for more info.
# | Debian | Darwin |
info_errs = [ # |--------|--------|
errno.ESHUTDOWN, # | 32 | 32 |
errno.EAFNOSUPPORT, # | 97 | 47 |
errno.ECONNRESET, # | 104 | 54 |
errno.ETIMEDOUT, # | 110 | 60 |
]

gos_name = TCLIServiceClient.GetOperationStatus.__name__
if method.__name__ == gos_name:
# retry on timeout. Happens a lot in Azure and it is safe as data has not been sent to server yet
if method.__name__ == gos_name or err.errno == errno.ETIMEDOUT:
retry_delay = bound_retry_delay(attempt, self._retry_delay_default)

# fmt: off
# The built-in errno package encapsulates OSError codes, which are OS-specific.
# log.info for errors we believe are not unusual or unexpected. log.warn for
# for others like EEXIST, EBADF, ERANGE which are not expected in this context.
#
# I manually tested this retry behaviour using mitmweb and confirmed that
# GetOperationStatus requests are retried when I forced network connection
# interruptions / timeouts / reconnects. See #24 for more info.
# | Debian | Darwin |
info_errs = [ # |--------|--------|
errno.ESHUTDOWN, # | 32 | 32 |
errno.EAFNOSUPPORT, # | 97 | 47 |
errno.ECONNRESET, # | 104 | 54 |
errno.ETIMEDOUT, # | 110 | 60 |
]

# fmt: on
log_string = f"{gos_name} failed with code {err.errno} and will attempt to retry"
if err.errno in info_errs:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp