Skip to content

Add support for InfiniteTimeSpan in SetCommandTimeout. - #25085

Merged
roji merged 5 commits into
dotnet:mainfrom
taha-ghadirian:main
Jun 15, 2021
Merged

roji merged 5 commits into
dotnet:mainfrom
taha-ghadirian:main

Conversation

@taha-ghadirian

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

Copy link
Copy Markdown
Contributor

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

@roji roji left a comment

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@roji Requested changes applied.

@roji

roji commented Jun 15, 2021

Copy link
Copy Markdown
Member

Can you please add some testing in CommandConfigurationTests.CommandTimeout?

@taha-ghadirian

Copy link
Copy Markdown
Contributor Author

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

@roji roji left a comment

Copy link
Copy Markdown
Member

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