Closed wxilas21 closed 5 years ago
Is there a reason you're using Http.Sys and Kestrel? (https://github.com/aspnet/KestrelHttpServer/issues/3074)
The reason I started using Kestrel Server was that I used the Dotnet framework for the server of the previous service. Also, since the next project should be able to service in Linux, I have to use dotnet core which supports cross platform.
I started the project three months ago using Kestrel. This (https://github.com/aspnet/KestrelHttpServer/issues/3074) has encountered a problem and I was considering using HttpSys. Because there was an internal opinion that the server should run on Windows. However, I found another problem with HttpSys. And I have done many tests. But I can not find a solution and I ask one question.
Please advise on this issue.
Open the dump in Visual Studio or WinDbg and look at the call stacks for active threads. How many threads do you see? Are any stuck at suspicious places like calls to Wait()?
I checked the dump. The thread only had one main thread. This is the call stack of the main thread.
ntdll!NtDeviceIoControlFile+0xa
httpapi!HttpApiSynchronousDeviceControl+0x73
httpapi!HttpCreateServerSession+0x6e
0x00007fff35ddad2d Microsoft_AspNetCore_Server_HttpSys!Microsoft.AspNetCore.Server.HttpSys.ServerSession..ctor()$##60001E3+0x47 Microsoft_AspNetCore_Server_HttpSys!Microsoft.AspNetCore.Server.HttpSys.HttpSysListener..ctor(Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions, Microsoft.Extensions.Logging.ILoggerFactory)$##6000171+0xd1 Microsoft_AspNetCore_Server_HttpSys!Microsoft.AspNetCore.Server.HttpSys.MessagePump..ctor(Microsoft.Extensions.Options.IOptions
135dd9089 0x00007fff
35dd9010
Microsoft_AspNetCore_Hosting!Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()$##60000D1+0x1c
0x00007fff`35da1505
coreclr!CallDescrWorkerInternal+0x83 [E:\A_work\36\s\src\vm\amd64\CallDescrWorkerAMD64.asm @ 101]
coreclr!CallDescrWorkerWithHandler+0x53 [e:\a_work\36\s\src\vm\callhelpers.cpp @ 78]
coreclr!MethodDescCallSite::CallTargetWorker+0x2b5 [e:\a_work\36\s\src\vm\callhelpers.cpp @ 628]
coreclr!MethodDescCallSite::Call+0xb [e:\a_work\36\s\src\vm\callhelpers.h @ 433]
coreclr!RunMain+0x229 [e:\a_work\36\s\src\vm\assembly.cpp @ 1707]
coreclr!Assembly::ExecuteMainMethod+0x228 [e:\a_work\36\s\src\vm\assembly.cpp @ 1817]
coreclr!CorHost2::ExecuteAssembly+0x206 [e:\a_work\36\s\src\vm\corhost.cpp @ 491]
coreclr!coreclr_execute_assembly+0xd6 [e:\a_work\36\s\src\dlls\mscoree\unixinterface.cpp @ 407]
hostpolicy!run+0xfd0
hostpolicy!corehost_main+0x7d
hostfxr!execute_app+0x1d8
hostfxr!fx_muxer_t::read_config_and_execute+0xb7a
hostfxr!fx_muxer_t::handle_exec_host_command+0x242
hostfxr!fx_muxer_t::execute+0x346
hostfxr!hostfxr_main_startupinfo+0x95
GameServer_exe!run+0x370
GameServer_exe!invoke_main+0x22 [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 79]
GameServer_exe!
That call stack is the server trying to start up. I don't know why it would hang, I'll ask some httpapi experts.
In the meantime, can you clarify your initial statement? You had successfully started your application and served traffic for a day before it hung. That's when you shut it down and restarted it and ran into the issue with the stack trace given above. Is this correct? Do you have any dumps from the initial issue?
That call stack is the server trying to start up. I don't know why it would hang, I'll ask some httpapi experts.
In the meantime, can you clarify your initial statement? You had successfully started your application and served traffic for a day before it hung. That's when you shut it down and restarted it and ran into the issue with the stack trace given above. Is this correct? Do you have any dumps from the initial issue?
Yes, that's right. Symptoms appeared after a day or so. And when you restart, it hangs. And this Call Site is a dump when it hangs.
We'll look at the link you've shown and we'll look at it in detail.
I saw the link you gave me. It is similar to my situation. When the HttpSys server shut down, the console identified the remaining issues in the TaskManager that disappeared. And when you start again, the program hangs in the same situation as the dump.
Can you capture a dump before restarting the process? It will be interesting to see what the original error was.
Sharing the other dump may also be interesting. You can send a download link to the e-mail address in my profile.
The next update is (UTC + 9) 11-09 AM 10:30. I will get a dump and send you an email before updating. Thank you.
I sent an email. Thank you.
As I mentioned in https://github.com/aspnet/KestrelHttpServer/issues/3074#issuecomment-439545577, try installing the KB patch. I've verified that the TCP/IP bug in Windows was causing that issue.
Thank you for your interest in the old issue. I will check if Windows KB4338824 is updated. And @Tratcher continues to help you solve this issue.
I will leave a note as soon as I can confirm that this update is installed or not.
Thank you.
We're closing this issue as no response or updates have been provided in a timely manner and we have been unable to reproduce it. If you have more details and are encountering this issue please add a new reply and re-open the issue.
There is an issue that hangs when running HttpSys Server for more than one day, shutting down and restarting. And doing TaskKill in this state does not kill the process. In this case, there are issues that require a reboot. We have a dump file at this time. I would appreciate your help in solving the problem.
Execution environment
Using AWS EC2 Windows server 2012 R2 Version 6.3 ( build 9600) I used Dotnet core SDK 2.1.403, Runtime 2.1.5