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

[BUG] ServiceBus receiver refuses to accept messages with unbounded TTL #17444

Closed
3 tasks done
aerisnju opened this issue Nov 10, 2020 · 6 comments
Closed
3 tasks done
Assignees
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. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus Track 1

Comments

@aerisnju
Copy link

aerisnju commented Nov 10, 2020

Describe the bug
Bug found in SDK: microsoft-azure-servicebus 3.5.0 (not azure-messaging-servicebus)

The service bus receiver refuses to accept messages with unbounded TTL, producing IllegalArgumentException exceptions.

We can create a queue with unbounded (unlimited, -1) TTL. So a message may not have a positive TTL. When the client receives such a message, it refuses to accepted the message because it expects a positive TTL.

This issue was introduced in #13586. I suggest rollback this change or fix the TTL check when receiving a message.

Exception or Stack Trace

java.lang.IllegalArgumentException: timeToLive must be positive duration.	
at com.microsoft.azure.servicebus.Message.setTimeToLive(Message.java:181) ~[azure-servicebus-3.5.0.jar:?]	
at com.microsoft.azure.servicebus.MessageConverter.convertAmqpMessageToBrokeredMessage(MessageConverter.java:134) ~[azure-servicebus-3.5.0.jar:?]	
at com.microsoft.azure.servicebus.MessageConverter.convertAmqpMessageToBrokeredMessage(MessageConverter.java:95) ~[azure-servicebus-3.5.0.jar:?]	
at com.microsoft.azure.servicebus.MessageReceiver.lambda$receiveAsync$12(MessageReceiver.java:474) ~[azure-servicebus-3.5.0.jar:?]	
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642) ~[?:?]	
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]	
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]	
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]	
at java.lang.Thread.run(Thread.java:834) [?:?]

To Reproduce

  1. Create a queue with unbounded TTL.
  2. Write a simple test program using microsoft-azure-servicebus version 3.5.0 (3.4.0 does not have such issue) to receive messages from the queue.
  3. Send a message without TTL set
  4. The program is unable to receive a single message but producing many IllegalArgumentException.

Code Snippet
N.A. Just create a IMessageReceiver and call its receive() or receiveAsync().

Expected behavior
Messages are received successfully.

Screenshots
N.A.

Setup (please complete the following information):

  • OS: Ubuntu 2004 in docker (OS independent)
  • IDE : IDE independent
  • Library: microsoft-azure-servicebus 3.5.0

Additional context
N.A.

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

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 10, 2020
@joshfree joshfree added Client This issue points to a problem in the data-plane of the library. Service Bus Track 1 labels Nov 13, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 13, 2020
@joshfree
Copy link
Member

@yvgopal could you please assist with this service bus v3 issue?

/cc @hemanttanwar

@yvgopal
Copy link
Member

yvgopal commented Nov 18, 2020

I will be investigating this.

@yvgopal
Copy link
Member

yvgopal commented Nov 18, 2020

@aerisnju How are you creating a queue with negative ttl? what is the SDK you are using to create that queue?

@yvgopal
Copy link
Member

yvgopal commented Nov 19, 2020

Fix is coming in #17678. will soon release a new version of the SDK.
Silly bug. Any of our tests should have caught it. I will verify why our tests didn't run for that commit which introduced the regression.

@aerisnju
Copy link
Author

aerisnju commented Nov 19, 2020

@yvgopal The TTL is TimeSpan.MaxValue in C#. For servicebus standard and premium layer this is the default value.
It cannot be set directly in Azure portal but can be set by management client.
I don't know why it cannot pass the positive number check.

@yvgopal
Copy link
Member

yvgopal commented Nov 19, 2020

Just released version 3.5.1 with the fix. It should be available for download in the next few hours.

@yvgopal yvgopal closed this as completed Nov 19, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-java that referenced this issue Jan 24, 2022
[Azure App Configuration] Add 2021-10-01-preview version (Azure#17444)

* Add 2021-10-01 folder

* Update readme

* Remove wrong folder

* Add 2021-10-01-preview folder

* Update enum value
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus Track 1
Projects
None yet
Development

No branches or pull requests

4 participants