-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
I am using AutoLockRenew class register method after receiving message from azure service bus topic subscription using azure sdk for python.
Even if you use AutoLockRenew.register() method in python which takes care of automatically renewing the lock for you - in case the renewable.renew_lock() throws an exception if message lock expired, it fails silently!
The parent thread which is still executing business logic keeps on executing (until it calls message.complete() when actually it would know about this) but the same time, the same message appears in the queue and second instance takes it up for processing! This mean the same message is now being processed simultaneously by 2 different receivers!
The exception should be propagated to the parent thread calling the auto renew so that it can stop processing the message and avoid duplicate message handling by another subscriber.
Just wanted to understand is this by design and what was the original thought process in failing this exception silently on a different thread.
The code looks like below -
auto_renewer = AutoLockRenew()
with sub_client.get_receiver() as receiver:
for message in receiver:
auto_renewer.register(message)
.......