Configurable connection pool size in azure.storage package
- Package Name: azure-storage-blob, azure-identity
- Package Version: 12.19.1 - 1.15.0
- Operating System: Ubuntu
- Python Version: 3.10.12
Describe the bug I've seen configurable pool_size in here https://github.com/Azure/azure-sdk-for-python/issues/12102 but I am using BlobServiceClient and this doesn't work for here.
To Reproduce Steps to reproduce the behavior: initialize with BlobServiceClient. Have a 10 threads. And simultaneously execute #get_blob_client#upload_blob
Errors:
WARNING:urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0f5be97a30>: Failed to establish a new connection: [Errno 111] Connection refused')': /session/**HIDDEN**/url
WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: localhost. Connection pool size: 1
My BlobServiceClient
BlobServiceClient(
AZURE_ACCOUNT_URL,
credential=ClientSecretCredential(
client_id=os.getenv("AZURE_CLIENT_ID"),
client_secret=os.getenv("AZURE_CLIENT_SECRET"),
tenant_id=os.getenv("AZURE_TENANT_ID"),
),
)
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jalauzon-msft @vincenttran-msft.
Hey @bertek41, how are you specifying your pooling configuration? I believe you should be able to supply your own transport to the BlobServiceClient as shown here.
Hi @bertek41. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hey @bertek41, how are you specifying your pooling configuration? I believe you should be able to supply your own transport to the
BlobServiceClientas shown here.
I tried the transport parameter, but no matter what I type, nothing changes. I even gave str to the transport parameter, it didn't give any warning, I don't think it worked.
Hi @bertek41 - The transport parameter accepts should take in a Transport object such RequestsTransport as shown here, rather than a string. For a list of other Transport classes supported, please refer to this documentation.
As @pvaneck mentioned, a snippet of code that shows how you are creating your client and specifying pooling configuration would allow us to better assist.
Hi @bertek41. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
I figured out. If I use BlobServiceClient like this:
BlobServiceClient(
AZURE_ACCOUNT_URL,
credential=ClientSecretCredential(
client_id=os.getenv("AZURE_CLIENT_ID"),
client_secret=os.getenv("AZURE_CLIENT_SECRET"),
tenant_id=os.getenv("AZURE_TENANT_ID"),
),
transport=...
)
Nothing changes. But when I use like this:
BlobServiceClient.from_connection_string(AZURE_CONNECTION_STRING, transport=...)
Service does use transport.
Hi @bertek41. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.