-
Notifications
You must be signed in to change notification settings - Fork 3.3k
azure-servicebus.AutoLockRenewer change ThreadPool usage #19362
Copy link
Copy link
Closed
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.MessagingMessaging crewMessaging crewService Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues 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 appreciatedThis 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.Workflow: 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 thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Assignees
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.MessagingMessaging crewMessaging crewService Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues 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 appreciatedThis 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.Workflow: 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 thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Is your feature request related to a problem? Please describe.
The azure.servicebus.AutoLockRenewer is implicitly limited to renewing locks for at most
max_workersnumber 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_workersmessages 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_workersfutures 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_workersmessages off of the queue could be desirable (e.g. prefetching messages).