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

Add support for InfiniteTimeSpan in SetCommandTimeout. #25085

Merged
merged 5 commits into from
Jun 15, 2021
Merged

Add support for InfiniteTimeSpan in SetCommandTimeout. #25085

merged 5 commits into from
Jun 15, 2021

Conversation

taha-ghadirian
Copy link
Contributor

@taha-ghadirian taha-ghadirian commented Jun 12, 2021

Add support for InfiniteTimeSpan In Context.Database.SetCommandTimeout().

resolves #25068 Comment 858547728

@taha-ghadirian taha-ghadirian marked this pull request as ready for review June 12, 2021 10:09
@taha-ghadirian taha-ghadirian marked this pull request as draft June 12, 2021 10:14
@taha-ghadirian taha-ghadirian marked this pull request as ready for review June 12, 2021 11:38
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

This change isn't correct: passing null to the overload which accepts an int? doesn't apply an infinite timeout - it applies "the default value used is defined by the underlying ADO.NET data provider" (see the XML docs there).

As per the documentation on DbCommand.CommandTimeout, for an infinite timeout we should set to 0.

@roji roji self-assigned this Jun 13, 2021
taha-ghadirian and others added 2 commits June 13, 2021 12:37
Co-authored-by: Shay Rojansky <roji@roji.org>
@taha-ghadirian
Copy link
Contributor Author

Requested changes done,
Thanks for letting code problems 🙏

@taha-ghadirian taha-ghadirian requested a review from roji June 13, 2021 08:19
@taha-ghadirian
Copy link
Contributor Author

@roji Requested changes applied.

@roji
Copy link
Member

roji commented Jun 15, 2021

Can you please add some testing in CommandConfigurationTests.CommandTimeout?

@taha-ghadirian
Copy link
Contributor Author

Hello @roji, Thanks for your note. Tests added and checked as successful ;)

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Thanks, I split out a separate test but otherwise all looks good.

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

Successfully merging this pull request may close these issues.

Timeout.InfiniteTimeSpan not supported.
3 participants