Open Ivony opened 6 months ago
Proposal:
Sorry, I'm having a little trouble understanding what behavior you're seeing. Are you saying that all requests to your kestrel server are rejected with "connection reset by peer"? Or maybe you're saying that the port is still in use after kestrel exits? A sample program demonstrating the problem or even the server logs (ideally, level trace from "Microsoft.AspNetCore") would be very helpful.
Sorry, I'm having a little trouble understanding what behavior you're seeing. Are you saying that all requests to your kestrel server are rejected with "connection reset by peer"? Or maybe you're saying that the port is still in use after kestrel exits? A sample program demonstrating the problem or even the server logs (ideally, level trace from "Microsoft.AspNetCore") would be very helpful.
curl http://ip:5000/heal All requests return curl: (56) Recv failure: Connection reset by peer
@Ivony did you run into this?
@785468931 Is it possible the connection is being blocked by the firewall on the server? Do you have some reason to believe the request is reaching kestrel and then being rejected?
@785468931 Is it possible the connection is being blocked by the firewall on the server? Do you have some reason to believe the request is reaching kestrel and then being rejected?
I confirmed that there is no problem with the local firewall. I also got the same error response when using curl localhost(curl http://localhost:5000/heal).
@785468931 I think the next step would be to collect a server log so we can see whether it's receiving the connection and, if so, why it's rejecting it. A pcap might also be useful.
I can't tell whether @785468931 and @Ivony have related problems because I'm still not sure I understand @Ivony's concern/request.
Is there an existing issue for this?
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