-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ServiceBus] Improve auto lock renewer implementation #20071
[ServiceBus] Improve auto lock renewer implementation #20071
Conversation
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Outdated
Show resolved
Hide resolved
sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
addressing issue: #19362
currently sync auto lock renewer is implemented the way that each thread in the ThreadPoolExecutor handles lock renewal for one message/session at a time.
This could bring trouble when the amount of messages needed to be auto lock renewed is greater than the max workers of the executor -- E.g., executor has 4 workers, user register 10 messages, only the first 4 messages will be auto lock renewed.
This PR has proposed a new approach to support messages amount > max workers amount which is described as following:
The overall design is to decouple the renew process via a queue so that worker threads could keep popping and handling renew tasks from the queue.
The algorithm is: