Description
Bug Description
Token refresh in the async Client
class uses the requests.Request
transport of the google auth library
alloydb-python-connector/google/cloud/alloydb/connector/client.py
Lines 186 to 188 in 6cc4c8e
This means it is doing blocking I/O on the asyncio loop. At the minimum, the fetch seems like it needs to be delegated to a thread with asyncio.to_thread
.
For reference, google-auth-library-python does have some baking experimental APIs for async
https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/transport/_aiohttp_requests.py
https://github.com/googleapis/google-auth-library-python/blob/main/google/auth/_default_async.py
However, assuming using the experimental APIs was ok, it's probably still not ready for general use because at least, impersonated credentials don't yet have an async version (in certain token refresh logic I've written, I use the async APIs for normal creds and to_thread
for impersonated, but it seems too complicated for this library).
Example code (or command)
No response
Stacktrace
No response
Steps to reproduce?
- ?
- ?
- ?
...
Environment
- OS type and version:
- Python version:
- AlloyDB Python Connector version:
Additional Details
No response
Activity