You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Type 3] Audit thread-safety or other concurrency #1148
Currently it is not very clear if this library is thread-safe or not. According to psf/requests#2766 a single session per thread is preferred so should we create multiple Server instances for each thread?
Alternatively I would be very interested in an asyncio Version of this library using httpx or a similar library. This is generally the direction in which Python is now also moving and a lot easier to reason about than multithreaded concurrency. Furthermore it would lead to better code style as all the hidden IO which is currently performed would then be eliminated.
Ran into a similar issue, and as a result, I am quite sure the library is not thread safe.
These kinds of calls were causing race conditions for me (and as a result, giving me PDFs with the wrong filenames). I decided to use a semaphore for these calls in the meantime.
To reproduce, I was using this code with ThreadPoolExecutor, and specifying different filters (via pdf_request_options) for the same view. E.g.,
You can also see the problem in a different way with the latest version of the library and the logging module, e.g., I can get multiple such calls in a row because this blocking state is not shared across threads.
This problem appears to extend to the Endpoint class itself, as rewriting _blocking_request and send_request_while_show_progress_threaded alone did not fix the problem.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
Activity
dxdc commentedon Apr 26, 2023
Ran into a similar issue, and as a result, I am quite sure the library is not thread safe.
These kinds of calls were causing race conditions for me (and as a result, giving me PDFs with the wrong filenames). I decided to use a semaphore for these calls in the meantime.
To reproduce, I was using this code with ThreadPoolExecutor, and specifying different filters (via pdf_request_options) for the same view. E.g.,
You can also see the problem in a different way with the latest version of the library and the logging module, e.g., I can get multiple such calls in a row because this blocking state is not shared across threads.
This problem appears to extend to the Endpoint class itself, as rewriting
_blocking_requestandsend_request_while_show_progress_threadedalone did not fix the problem.server-client-python/tableauserverclient/server/endpoint/endpoint.py
Lines 79 to 95 in 307d8a2
github-actions commentedon Aug 18, 2026
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
septatrix commentedon Aug 23, 2026
Stil relevant
dxdc commentedon Aug 24, 2026
@septatrix I just wrote up PR #1871. httpx would be better, but is a larger refactor.
jorwoods commentedon Aug 24, 2026
@dxdc Awesome! Unfortunately it seems to me like HTTPX may need to be avoided.