Kestrel will not accept new connection.
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
send request to Kestrel server on Linux get an error: connection reset by peer.
netstat shows TCP Connection status is Listening, Recv-Q is 257 and no changes in long term.
in TCP Listening status, Recv-Q means **how many connection wait for accept**.
memory dump information shows:

`TransportManager._transports[0].AcceptLoopTask.Status` is RanToCompletion.
`TransportManager._transports` is the transport collection of endpoint binding.
diagnosis source code:
in this code will set AcceptLoopTask.Status to RanToCompletion:
https://github.com/dotnet/aspnetcore/blob/d6f154cca3863703cf87c8b840eea9cbe20229b2/src/Servers/Kestrel/Core/src/Internal/ConnectionDispatcher.cs#L74
and when this Task completed( break from accept loop ). Kestrel will **not** accept any connection, looks like go hibernation.
and **not found critical error log in log file**.
so, it's not breaking in
https://github.com/dotnet/aspnetcore/blob/d6f154cca3863703cf87c8b840eea9cbe20229b2/src/Servers/Kestrel/Core/src/Internal/ConnectionDispatcher.cs#L70
The presumed path is:
https://github.com/dotnet/aspnetcore/blob/d6f154cca3863703cf87c8b840eea9cbe20229b2/src/Servers/Kestrel/Core/src/Internal/ConnectionDispatcher.cs#L51
whatever,
There is possible of go out from **accept loop** and not quit or crush.
### Expected Behavior
_No response_
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version
dotnet 6.0.16
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.