Skip to content
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

lock supplied is invalid #440

Open
cristibozga opened this issue Dec 31, 2024 · 0 comments
Open

lock supplied is invalid #440

cristibozga opened this issue Dec 31, 2024 · 0 comments

Comments

@cristibozga
Copy link

cristibozga commented Dec 31, 2024

We are migration from the old servicebus sdk to the new one and after the first deployment we had several errors.
One of the problems is:

"{\"az.sdk.message\":\"The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue. For more information please see https://aka.ms/ServiceBusExceptions . Reference:249d89d2-7020-4ded-8d63-f7d6d1ad5a5e, TrackingId:bab4ac2000007d9111c2b9d16771f07d_G42_B7, SystemTracker:gi::G42:-1773474619:EsbPrebookingCancelledQueue_90b47a_1735520375306, bi::in-connection14043(G42-319093)::session14047::link297974225, Timestamp:2024-12-31T03:48:41, errorContext[NAMESPACE: sbus-rnd-regression-main-tjkgat.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: EsbPrebookingCancelledQueue, REFERENCE_ID: EsbPrebookingCancelledQueue_90b47a_1735520375306, LINK_CREDIT: 8]\",\"exception\":\"The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue. For more information please see https://aka.ms/ServiceBusExceptions . Reference:249d89d2-7020-4ded-8d63-f7d6d1ad5a5e, TrackingId:bab4ac2000007d9111c2b9d16771f07d_G42_B7, SystemTracker:gi::G42:-1773474619:EsbPrebookingCancelledQueue_90b47a_1735520375306, bi::in-connection14043(G42-319093)::session14047::link297974225, Timestamp:2024-12-31T03:48:41, errorContext[NAMESPACE: sbus-rnd-regression-main-tjkgat.servicebus.windows.net. ERROR CONTEXT: N/A, PATH: EsbPrebookingCancelledQueue, REFERENCE_ID: EsbPrebookingCancelledQueue_90b47a_1735520375306, LINK_CREDIT: 8]\",\"connectionId\":\"MF_1fc332_1735520375306\"}

I see the problems appeared on the same queue 5 times in an interval of 20 seconds on a non-session queue.
The code to create the consumer:

private ServiceBusProcessorClient createQueueConsumer(String queuePath, QueueListenerProperties queueListenerProperties) {

     ServiceBusClientBuilder.ServiceBusProcessorClientBuilder builder = new ServiceBusClientBuilder()
             .connectionString(serviceBusProperties.getConnectionString())
             .retryOptions(retryOptions(queueListenerProperties))
             .processor()
             .maxConcurrentCalls(queueListenerProperties.getMaxConcurrentCalls())
             .queueName(queuePath);
     builder.processMessage(messageHandler);
     builder.processError(errorHandler);
     return builder.buildProcessorClient();
 }

 private static AmqpRetryOptions retryOptions(QueueListenerProperties properties) {
     AmqpRetryOptions o = new AmqpRetryOptions();
     o.setTryTimeout(Duration.ofMillis(properties.getTimeout()));
     o.setMode(AmqpRetryMode.FIXED);
     return o;
 }
}

Timeout= 3 sec.
I also see that the queue has now a dead-letter message. i don't know if it is directly related to this problem.

Can you, please, tell us how can we avoid this problem?

SDK version 7.17.7
java version: 17

Thank you,
Cristi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant