Skip to content

Duplicate message to subscribers even using AutoLockRenew #11611

@engage-deepakagarwal

Description

@engage-deepakagarwal

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)
        .......

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.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