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

Consider setting a finite ConnectTimeout by default #1678

Closed
MihaZupan opened this issue Apr 28, 2022 · 0 comments · Fixed by #1991
Closed

Consider setting a finite ConnectTimeout by default #1678

MihaZupan opened this issue Apr 28, 2022 · 0 comments · Fixed by #1991
Assignees

Comments

@MihaZupan
Copy link
Member

MihaZupan commented Apr 28, 2022

Starting with 6.0, the consequences of a connection attempt that takes a long time to fail, or somehow becomes stuck are much higher than before (memory leaks, more failed requests ...).

In .NET 7, we made a change in the connection pool where we will now cancel a connection attempt 5 seconds after the request that initiated it completes (or is canceled).

The main mitigation for this in 6.0 is to set SocketsHttpHandler.ConnectTimeout to a finite value. We should consider setting such a default in YARP.
My preference would be that we make the change regardless of target framework (also change it for 7.0).

See #1833 (comment) for more context on this change.

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