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

Disable default HttpClient/HttpWebRequest timeouts #18050

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Jan 19, 2021

I double check and all the cases handled by default timeouts are already handled by the Azure.Core pipeline, ResponseBodyPolicy in particular.

Fixes: #18047


// Timeouts are handled by the pipeline
request.Timeout = Timeout.Infinite;
request.ReadWriteTimeout = Timeout.Infinite;
Copy link
Contributor

Choose a reason for hiding this comment

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

https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest.readwritetimeout?view=net-5.0#remarks this talks about timeouts on Stream.Write as well. I recall we apply NetworkTimeout on Stream.Read. How is Stream.Write secured by NetworkTimeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now the only Write we do is during content sending. The content is written during the Transport.SendAsync call and is guarded by this timeout:

https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/core/Azure.Core/src/Pipeline/Internal/ResponseBodyPolicy.cs#L43-L60

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the thorough review.

@pakrym pakrym merged commit 541b958 into Azure:master Jan 19, 2021
@pakrym pakrym deleted the pakrym/Disable-default-HttpClient-HttpWebRequest-timeouts branch January 19, 2021 23:04
minnieliu pushed a commit to minnieliu/azure-sdk-for-net that referenced this pull request Jan 23, 2021
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.

Consider disabling default timeouts in transports
3 participants