- Package Name: azure-servicebus
- Package Version: 7.11.1 and main
- Operating System: Linux
- Python Version: 3.11.5
Describe the bug
When using azure.servicebus.aio.ServiceBusClient() blocking calls to SSLContext .load_verify_locations() are made. Async libraries should not contain any blocking operations.
The call is made here:
|
context.load_verify_locations(ca_certs) |
and here:
|
ctx.load_verify_locations(cafile=certifi.where()) |
To Reproduce
from azure.servicebus.aio import ServiceBusClient
client = ServiceBusClient.from_connection_string(...)
async with client:
receiver = client.get_subscription_receiver(,,,)
async with receiver:
... # ^^ Observe that load_verify_locations() have been called
Expected behavior
Async libraries should avoid making blocking calls. The blocking operations should be called using executors or threads.
Additional context
For reference, this issue was discovered here: custom-components/zaptec#116 . Home Assistant have a detector which warns about blocking operations.
Describe the bug
When using
azure.servicebus.aio.ServiceBusClient()blocking calls to SSLContext.load_verify_locations()are made. Async libraries should not contain any blocking operations.The call is made here:
azure-sdk-for-python/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_transport_async.py
Line 198 in 5ae05fc
azure-sdk-for-python/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_transport_async.py
Line 232 in 5ae05fc
To Reproduce
Expected behavior
Async libraries should avoid making blocking calls. The blocking operations should be called using executors or threads.
Additional context
For reference, this issue was discovered here: custom-components/zaptec#116 . Home Assistant have a detector which warns about blocking operations.