[BUG] Frequent cases with Starting lock renewal messages in log and messages are not delivered #39833
Closed
3 tasks done
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Bus
Describe the bug
We have a problem with a Kubernetes service when it consumes messages from a ServiceBus topic. In some instances when extra processing is performed, it will stop processing further messages and the log message shows repeated instances of lock renewals. We are using the latest stable version of Azure Service Bus client for Java - Version 7.15.2. https://learn.microsoft.com/en-us/java/api/overview/azure/messaging-servicebus-readme?view=azure-java-stable.
Example logs:
This will often happen in less than 60 seconds from the message consumption even the message is received. Furthermore the message will not get cleared from the topic in the Azure ServiceBus console. It requires doing a restart of the Kubernetes service.
The Message Lock Duration is set to 30 seconds in the topic. If this is changed to 60 seconds then the logs above are spaced approximately 50 seconds apart.
Exception or Stack Trace
We don't observe any exceptions.
To Reproduce
Steps to reproduce the behavior:
I haven't created an exact cut-down / minimal example, however, the code used is trimmed below to describe what we're doing.
Code Snippet
The example code here is split into 4 files. The first 2 files exist in a common library while the second 2 files use this library in the Kubernetes service.
deadLetter()
method below. It simply looks for exceptions of instanceRetryableMessageException
. In this case it callscontext.abandon()
or else it callscontext.deadLetter(option)
. There's no evidence of any exceptions in the logs.maxAutoLockRenewDurationMinutes
above is set to 5 minutes.The code inside processNotificationEvent makes a database query. In the cases where I can reproduce the problem it also performs a remote procedure call, however, this takes less than 2 seconds. In these instances, it will quite frequently result in producing the lock messages and the services stops processing the messages.
Expected behavior
I don't expect to see the lock messages occurring and the service should be able to make the remote procedure call.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
If you suspect a dependency version mismatch (e.g. you see
NoClassDefFoundError
,NoSuchMethodError
or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:mvn dependency:tree -Dverbose
)Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: