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

Added info logging for response#511

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
jprakash-db merged 7 commits intorelease/v3.7.3fromjprakash-db/add-logging
Feb 23, 2025
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
18 changes: 10 additions & 8 deletionssrc/databricks/sql/auth/retry.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -345,23 +345,24 @@ def should_retry(self, method: str, status_code: int) -> Tuple[bool, str]:
if a retry would violate the configured policy.
"""

logger.info(f"Received status code {status_code} for {method} request")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

When we get 4xx or 5xx, do we only get a status code, or do we also get an error message of some sort?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@benc-db I have updated such that the error messages from the server are printed and not our custom messages


# Request succeeded. Don't retry.
if status_code == 200:
return False, "200 codes are not retried"

if status_code == 401:
raise NonRecoverableNetworkError(
"Received 401 - UNAUTHORIZED. Confirm your authentication credentials."
return (
False,
"Received 401 - UNAUTHORIZED. Confirm your authentication credentials.",
)

if status_code == 403:
raise NonRecoverableNetworkError(
"Received 403 - FORBIDDEN. Confirm your authentication credentials."
)
return False, "403 codes are not retried"

# Request failed and server said NotImplemented. This isn't recoverable. Don't retry.
if status_code == 501:
raise NonRecoverableNetworkError("Received code 501 from server.")
return False,"Received code 501 from server."

# Request failed and this method is not retryable. We only retry POST requests.
if not self._is_method_retryable(method):
Expand DownExpand Up@@ -400,8 +401,9 @@ def should_retry(self, method: str, status_code: int) -> Tuple[bool, str]:
and status_code not in self.status_forcelist
and status_code not in self.force_dangerous_codes
):
raise UnsafeToRetryError(
"ExecuteStatement command can only be retried for codes 429 and 503"
return (
False,
"ExecuteStatement command can only be retried for codes 429 and 503",
)

# Request failed with a dangerous code, was an ExecuteStatement, but user forced retries for this
Expand Down
6 changes: 6 additions & 0 deletionssrc/databricks/sql/auth/thrift_http_client.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -198,6 +198,12 @@ def flush(self):
self.message = self.__resp.reason
self.headers = self.__resp.headers

logger.info(
"HTTP Response with status code {}, message: {}".format(
self.code, self.message
)
)

@staticmethod
def basic_proxy_auth_headers(proxy):
if proxy is None or not proxy.username:
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp