Skip to content

azure-servicebus.AutoLockRenewer change ThreadPool usage #19362

@m-credera

Description

@m-credera

Is your feature request related to a problem? Please describe.
The azure.servicebus.AutoLockRenewer is implicitly limited to renewing locks for at most max_workers number of messages. For an application that takes many messages off of the queue for parallel processing, this can present problems.

The azure.servicebus.AutoLockRenewer uses a single future inside of a ThreadPoolExecutor to monitor messages and renew locks. This means it's limited to monitoring at most max_workers messages at a time (since a thread pool only runs one future per-thread until the future completes).

Describe the solution you'd like
An alternative implementation could instead use max_workers futures monitoring a set of messages per future rather than a single message per future.

Describe alternatives you've considered
An alternative solution would be to implement parallelism with each worker taking a message off of the queue for itself to process. This is certainly possible, but there are still cases where taking more than max_workers messages off of the queue could be desirable (e.g. prefetching messages).

Metadata

Metadata

Assignees

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.help wantedThis issue is tracking work for which community contributions would be welcomed and appreciatedissue-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

Relationships

None yet

Development

No branches or pull requests

Issue actions