-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 response read timeouts #10128
Add response read timeouts #10128
Conversation
/// <summary> | ||
/// The timeout for a single operation. | ||
/// </summary> | ||
public TimeSpan TryTimeout { get; set; } = TimeSpan.FromSeconds(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @KrzysztofCwalina
I took the default HttpClient timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of and/or documented in the General Guidelines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the name a little hard to wrap my head around at first glance. PerTryTimeout
is kind of awkward but matches the pipeline position naming with PerCall
, etc. I don't feel strongly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to NetworkTimeout
} | ||
|
||
#if NETCOREAPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET Framework doesn't react to cancellation token on response reads.
sdk/core/Azure.Core/src/Pipeline/Internal/ResponseBodyPolicy.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really awesome!
/// <summary> | ||
/// The timeout for a single operation. | ||
/// </summary> | ||
public TimeSpan TryTimeout { get; set; } = TimeSpan.FromSeconds(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of and/or documented in the General Guidelines?
/// <summary> | ||
/// The timeout for a single operation. | ||
/// </summary> | ||
public TimeSpan TryTimeout { get; set; } = TimeSpan.FromSeconds(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the name a little hard to wrap my head around at first glance. PerTryTimeout
is kind of awkward but matches the pipeline position naming with PerCall
, etc. I don't feel strongly here.
@@ -73,7 +73,7 @@ public static HttpPipeline Build(ClientOptions options, HttpPipelinePolicy[] per | |||
diagnostics.LoggedHeaderNames.ToArray(), diagnostics.LoggedQueryParameters.ToArray())); | |||
} | |||
|
|||
policies.Add(BufferResponsePolicy.Shared); | |||
policies.Add(new ResponseBodyPolicy(options.Retry.NetworkTimeout)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if the timeout was changed, and if not, use the shared policy
Limitations: