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

Reduce DefaultPooledConnectionIdleTimeout default #52687

Merged
merged 2 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static partial class HttpHandlerDefaults
public const bool DefaultUseDefaultCredentials = false;
public const bool DefaultCheckCertificateRevocationList = false;
public static readonly TimeSpan DefaultPooledConnectionLifetime = Timeout.InfiniteTimeSpan;
public static readonly TimeSpan DefaultPooledConnectionIdleTimeout = TimeSpan.FromMinutes(2);
public static readonly TimeSpan DefaultPooledConnectionIdleTimeout = TimeSpan.FromMinutes(1);
public static readonly TimeSpan DefaultExpect100ContinueTimeout = TimeSpan.FromSeconds(1);
public static readonly TimeSpan DefaultConnectTimeout = Timeout.InfiniteTimeSpan;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ public void PooledConnectionIdleTimeout_GetSet_Roundtrips()
{
using (var handler = new SocketsHttpHandler())
{
Assert.Equal(TimeSpan.FromMinutes(2), handler.PooledConnectionIdleTimeout);
Assert.Equal(TimeSpan.FromMinutes(1), handler.PooledConnectionIdleTimeout);

handler.PooledConnectionIdleTimeout = Timeout.InfiniteTimeSpan;
Assert.Equal(Timeout.InfiniteTimeSpan, handler.PooledConnectionIdleTimeout);
Expand Down Expand Up @@ -1957,7 +1957,7 @@ await Assert.ThrowsAnyAsync<Exception>(() =>
Assert.Equal(int.MaxValue, handler.MaxConnectionsPerServer);
Assert.Equal(64, handler.MaxResponseHeadersLength);
Assert.False(handler.PreAuthenticate);
Assert.Equal(TimeSpan.FromMinutes(2), handler.PooledConnectionIdleTimeout);
Assert.Equal(TimeSpan.FromMinutes(1), handler.PooledConnectionIdleTimeout);
Assert.Equal(Timeout.InfiniteTimeSpan, handler.PooledConnectionLifetime);
Assert.NotNull(handler.Properties);
Assert.Null(handler.Proxy);
Expand Down