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

[ServiceBus] Fix TTL on messages #21869

Merged
1 commit merged into from
Nov 24, 2021
Merged

[ServiceBus] Fix TTL on messages #21869

1 commit merged into from
Nov 24, 2021

Conversation

jyggen
Copy link
Contributor

@jyggen jyggen commented Nov 23, 2021

Using seconds on timedelta to set TTL leads to unexpected behaviour with, for example, timedelta(days=1):

azure.servicebus.exceptions.ServiceBusError: Argument TimeToLIve must be a positive timeout value. The provided value was 00:00:00.
Parameter name: TimeToLIve
Actual value was 00:00:00

Instead of seconds, total_seconds() should be used:

>>> timedelta(days=1).seconds
0
>>> timedelta(days=1).total_seconds()
86400.0

@ghost ghost added Service Bus customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 23, 2021
@ghost
Copy link

ghost commented Nov 23, 2021

Thank you for your contribution jyggen! We will review the pull request and get back to you soon.

@ghost
Copy link

ghost commented Nov 23, 2021

CLA assistant check
All CLA requirements met.

@yunhaoling
Copy link
Contributor

nice catch! thanks @jyggen for the PR!
it looks good to me, will merge it after passing the tests.

@yunhaoling yunhaoling self-assigned this Nov 24, 2021
@yunhaoling
Copy link
Contributor

/azp run python - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@yunhaoling yunhaoling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test passed, appreciate your contribution, your fix will be included in our next release🎉

@ghost
Copy link

ghost commented Nov 24, 2021

Hello @yunhaoling!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 0db03b1 into Azure:main Nov 24, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Bus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants