Skip to content

Blocking SSLContext call when using azure-servicebus  #37246

@sveinse

Description

@sveinse
  • 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:

and here:

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.

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.MessagingMessaging crewService Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions