Skip to content

Commit

Permalink
Merge branch 'master' into feature/cus-3546-fix-tableau-authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomezvillamor authored Dec 24, 2024
2 parents a4adcf0 + 87e7b58 commit b1efd9b
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
SiteItem,
TableauAuth,
)
from tableauserverclient.server.endpoint.exceptions import NonXMLResponseError
from tableauserverclient.server.endpoint.exceptions import (
InternalServerError,
NonXMLResponseError,
)
from urllib3 import Retry

import datahub.emitter.mce_builder as builder
Expand Down Expand Up @@ -1218,6 +1221,24 @@ def get_connection_object_page(
retry_on_auth_error=False,
retries_remaining=retries_remaining - 1,
)

except InternalServerError as ise:
# In some cases Tableau Server returns 504 error, which is a timeout error, so it worths to retry.
if ise.code == 504:
if retries_remaining <= 0:
raise ise
return self.get_connection_object_page(
query=query,
connection_type=connection_type,
query_filter=query_filter,
fetch_size=fetch_size,
current_cursor=current_cursor,
retry_on_auth_error=False,
retries_remaining=retries_remaining - 1,
)
else:
raise ise

except OSError:
# In tableauseverclient 0.26 (which was yanked and released in 0.28 on 2023-10-04),
# the request logic was changed to use threads.
Expand Down

0 comments on commit b1efd9b

Please sign in to comment.