From 851a1eeb3919851451c71217c9b43427d7ae37c5 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 4 Jun 2019 01:20:03 -0700 Subject: [PATCH] If libuv doesn't unwind gracefully log a warning (#10823) - We added 3 critical logs to see if there was a resource leak happeing during the loop thread shutdown, turns out that during testing its very common for the thread to not end immediately because of the latency of thread pool dispatching (the latency between queuing and execution of the work item). As a result, we log a warning instead of an error. --- src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvThread.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvThread.cs b/src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvThread.cs index de212ca89d..31f5049373 100644 --- a/src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvThread.cs +++ b/src/Servers/Kestrel/Transport.Libuv/src/Internal/LibuvThread.cs @@ -112,7 +112,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal Post(t => t.AllowStop()); if (!await WaitAsync(_threadTcs.Task, stepTimeout).ConfigureAwait(false)) { - _log.LogCritical($"{nameof(LibuvThread)}.{nameof(StopAsync)} failed to terminate libuv thread, {nameof(AllowStop)}"); + _log.LogWarning($"{nameof(LibuvThread)}.{nameof(StopAsync)} failed to terminate libuv thread, {nameof(AllowStop)}"); Post(t => t.OnStopRude()); if (!await WaitAsync(_threadTcs.Task, stepTimeout).ConfigureAwait(false))