Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry for request in use_server_version #1520

Open
ad-m-ss opened this issue Nov 1, 2024 · 1 comment
Open

Retry for request in use_server_version #1520

ad-m-ss opened this issue Nov 1, 2024 · 1 comment

Comments

@ad-m-ss
Copy link

ad-m-ss commented Nov 1, 2024

Describe the bug

We are indexing data from multiple Tableau instances as a service provider integrating with Tableau.
We observed flaky requests on some instances:

2024-11-01T08:42:57.565777616Z stderr F INFO 2024-11-01 08:42:57,565 server 14 140490986871680 Could not get version info from server: <class 'tableauserverclient.server.endpoint.exceptions.InternalServerError'>
2024-11-01T08:42:57.565846529Z stderr F 
2024-11-01T08:42:57.565851784Z stderr F Internal error 504 at https://XXXX/selectstar/api/2.4/serverInfo
2024-11-01T08:42:57.565860665Z stderr F b'<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body>\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx/1.25.3</center>\r\n</body>\r\n</html>\r\n'
2024-11-01T08:42:57.566048361Z stderr F INFO 2024-11-01 08:42:57,565 server 14 140490986871680 versions: None, 2.4

We observed that the request in use_server_version does not apply retry with exponential backoff, which is a good practice in such scenarios. There is no easy way to implement it, as this is implicit call in __init__.

Versions
Details of your environment, including:

  • Tableau Server version (or note if using Tableau Online)
  • Python version
  • TSC library version

To Reproduce
Steps to reproduce the behavior. Please include a code snippet where possible.

That issue is transistent.

1/ Initalize SDK:

        self._server = TSC.Server(
            base_url,
            use_server_version=True,
            http_options={"timeout": self.REQUEST_TIMEOUT},
        )

2/ Ensure that network connectivity to Tableau is unreliable and may drop connection.

Results
What are the results or error messages received?

See exception above.

@jorwoods
Copy link
Contributor

jorwoods commented Nov 4, 2024

While we consider adding this, there is a way to handle this locally. In the init, set it to False (the default), then call it separately.

self._server = TSC.Server(base_url)
# Wrap the below call in your exponential backoff retry loop.
self._server.use_server_version()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants