-
Notifications
You must be signed in to change notification settings - Fork 2.1k
JsonResult causes thread pool exhaustion via synchronous flushes #8486
Description
From @lorenzos70 on September 16, 2018 11:35
Hello,
I have a .net 4.6.2 project (for my web apis) that is referencing, among other libraries, Microsoft.AspNetCore 2.1.3. I recently upgraded it from version 1.1. Since the upgrade I experienced the following issues on my production win 2016 server:
-
my api logs often show the following messages:
-
Connection id ""xxxxxx"", Request id ""yyyyyy"": the connection was closed because the response was not read by the client at the specified minimum data rate
-
the request timed out because it was not sent by the client at a minimum of 240 bytes/second".
-
[Warning] Connection processing ended abnormally.
Microsoft.AspNetCore.Connections.ConnectionAbortedException: The connection was aborted
at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at System.IO.Pipelines.Pipe.DefaultPipeReader.GetResult(Int16 token)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.
d__1881.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol. <ProcessRequestsAsync>d__1871.MoveNext()
-
-
The apis become unresponsive (they are hosted on iis 10 on a windows 2016 server)
-
IIS logs show, at the same time, 502 errors while trying to call the api endoints
-
I also noticed heavy peaks of the CPU.
Remarks: the web api load has not increased and there haven't been any other major changes, apart from the upgrade of the Microsoft.AspNetCore that I mentioned above, so I am still trying to figure out what the problem could be. Any advice that could point me to the right direction?
Thanks
Lorenzo
Copied from original issue: aspnet/KestrelHttpServer#2936