From 143f13f9bc246150e6b5742c243e0514dfd0f4f6 Mon Sep 17 00:00:00 2001 From: Andrey Ilnitsky Date: Mon, 14 Feb 2022 11:31:00 -0800 Subject: [PATCH 1/3] [0.7.2] Start threads as background in HashedWheelTimer, LoopExecutor, ThreadDeathWatcher --- RELEASE_NOTES.md | 11 +++++++---- src/DotNetty.Buffers/DotNetty.Buffers.csproj | 2 +- src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj | 2 +- src/DotNetty.Codecs.Mqtt/DotNetty.Codecs.Mqtt.csproj | 2 +- .../DotNetty.Codecs.Protobuf.csproj | 2 +- .../DotNetty.Codecs.ProtocolBuffers.csproj | 2 +- .../DotNetty.Codecs.Redis.csproj | 2 +- src/DotNetty.Codecs/DotNetty.Codecs.csproj | 2 +- src/DotNetty.Common/DotNetty.Common.csproj | 2 +- src/DotNetty.Common/ThreadDeathWatcher.cs | 5 ++++- src/DotNetty.Common/Utilities/HashedWheelTimer.cs | 5 ++++- src/DotNetty.Handlers/DotNetty.Handlers.csproj | 2 +- .../DotNetty.Transport.Libuv.csproj | 2 +- src/DotNetty.Transport.Libuv/LoopExecutor.cs | 6 +++++- src/DotNetty.Transport/DotNetty.Transport.csproj | 2 +- src/shared/SharedAssemblyInfo.cs | 4 ++-- 16 files changed, 33 insertions(+), 20 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 6d820b8a..ac647149 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,8 +1,11 @@ +#### 0.7.2 February 14, 2022 +- Start threads as background in HashedWheelTimer, LoopExecutor, ThreadDeathWatcher + #### 0.7.1 December 15, 2021 - Revert to use background threads #### 0.7.0 June 11, 2021 -- Target net472 and netstandard2.0 +- Target net472 and netstandard2.0 - Microsoft.Extensions.Logging 5.0.0 - Microsoft.Extensions.Configuration 5.0.0 @@ -129,13 +132,13 @@ - Channel ID - Complete `LengthFieldBasedFrameDecoder` and `LengthFieldPrepender` - Resource leak detection support (basic is on by default for pooled byte buffers) -- Proper internal logging +- Proper internal logging - Reacher byte buffer API - Proper utilities set for byte buffers, strings, system properties -- Performance improvements in SingleThreadEventExecutor +- Performance improvements in SingleThreadEventExecutor #### 0.1.3 September 21 2015 -- Fixed `TcpSocketChannel` closure on graceful socket closure +- Fixed `TcpSocketChannel` closure on graceful socket closure - Better alignment of IChannel implementations to netty's expected behavior for `Open`, `Active`, `LocalAddress`, `RemoteAddress` - Proper port of `Default/IChannelPipeline` and `AbstractChannelHandlerContext` to enable channel handlers to run on different invoker. diff --git a/src/DotNetty.Buffers/DotNetty.Buffers.csproj b/src/DotNetty.Buffers/DotNetty.Buffers.csproj index f6f56a8c..ba7da0fb 100644 --- a/src/DotNetty.Buffers/DotNetty.Buffers.csproj +++ b/src/DotNetty.Buffers/DotNetty.Buffers.csproj @@ -6,7 +6,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: buffer management en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 True diff --git a/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj b/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj index 6338ce06..567db227 100644 --- a/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj +++ b/src/DotNetty.Codecs.Http/DotNetty.Codecs.Http.csproj @@ -8,7 +8,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: Http codec en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 true diff --git a/src/DotNetty.Codecs.Mqtt/DotNetty.Codecs.Mqtt.csproj b/src/DotNetty.Codecs.Mqtt/DotNetty.Codecs.Mqtt.csproj index 563e9726..7e14a1ed 100644 --- a/src/DotNetty.Codecs.Mqtt/DotNetty.Codecs.Mqtt.csproj +++ b/src/DotNetty.Codecs.Mqtt/DotNetty.Codecs.Mqtt.csproj @@ -7,7 +7,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: MQTT codec en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 false diff --git a/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj b/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj index 7f60d249..e8e7b3cc 100644 --- a/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj +++ b/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj @@ -7,7 +7,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: Protobuf Proto3 codec en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 false diff --git a/src/DotNetty.Codecs.ProtocolBuffers/DotNetty.Codecs.ProtocolBuffers.csproj b/src/DotNetty.Codecs.ProtocolBuffers/DotNetty.Codecs.ProtocolBuffers.csproj index e03592e2..884946bd 100644 --- a/src/DotNetty.Codecs.ProtocolBuffers/DotNetty.Codecs.ProtocolBuffers.csproj +++ b/src/DotNetty.Codecs.ProtocolBuffers/DotNetty.Codecs.ProtocolBuffers.csproj @@ -8,7 +8,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: ProtocolBuffers Proto2 codec en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 false diff --git a/src/DotNetty.Codecs.Redis/DotNetty.Codecs.Redis.csproj b/src/DotNetty.Codecs.Redis/DotNetty.Codecs.Redis.csproj index 5b4c8b2f..586377cd 100644 --- a/src/DotNetty.Codecs.Redis/DotNetty.Codecs.Redis.csproj +++ b/src/DotNetty.Codecs.Redis/DotNetty.Codecs.Redis.csproj @@ -7,7 +7,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: Redis codec en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 false diff --git a/src/DotNetty.Codecs/DotNetty.Codecs.csproj b/src/DotNetty.Codecs/DotNetty.Codecs.csproj index 372a703f..b89c9edb 100644 --- a/src/DotNetty.Codecs/DotNetty.Codecs.csproj +++ b/src/DotNetty.Codecs/DotNetty.Codecs.csproj @@ -7,7 +7,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: codecs en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 true diff --git a/src/DotNetty.Common/DotNetty.Common.csproj b/src/DotNetty.Common/DotNetty.Common.csproj index 5640fc46..13632d12 100644 --- a/src/DotNetty.Common/DotNetty.Common.csproj +++ b/src/DotNetty.Common/DotNetty.Common.csproj @@ -8,7 +8,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: common routines en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 True diff --git a/src/DotNetty.Common/ThreadDeathWatcher.cs b/src/DotNetty.Common/ThreadDeathWatcher.cs index 026decfb..7b3f736f 100644 --- a/src/DotNetty.Common/ThreadDeathWatcher.cs +++ b/src/DotNetty.Common/ThreadDeathWatcher.cs @@ -59,7 +59,10 @@ static void Schedule(Thread thread, Action task, bool isWatch) if (Interlocked.CompareExchange(ref started, 1, 0) == 0) { - var watcherThread = new Thread(s => ((IRunnable)s).Run()); + var watcherThread = new Thread(s => ((IRunnable)s).Run()) + { + IsBackground = true + }; watcherThread.Start(watcher); ThreadDeathWatcher.watcherThread = watcherThread; } diff --git a/src/DotNetty.Common/Utilities/HashedWheelTimer.cs b/src/DotNetty.Common/Utilities/HashedWheelTimer.cs index 1ccd1c23..2ecef70c 100644 --- a/src/DotNetty.Common/Utilities/HashedWheelTimer.cs +++ b/src/DotNetty.Common/Utilities/HashedWheelTimer.cs @@ -98,7 +98,10 @@ public HashedWheelTimer( tickInterval, long.MaxValue / this.wheel.Length)); } - this.workerThread = new Thread(st => this.worker.Run()); + this.workerThread = new Thread(st => this.worker.Run()) + { + IsBackground = true + }; this.maxPendingTimeouts = maxPendingTimeouts; diff --git a/src/DotNetty.Handlers/DotNetty.Handlers.csproj b/src/DotNetty.Handlers/DotNetty.Handlers.csproj index e44929f4..83fed99c 100644 --- a/src/DotNetty.Handlers/DotNetty.Handlers.csproj +++ b/src/DotNetty.Handlers/DotNetty.Handlers.csproj @@ -8,7 +8,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: handlers en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 false diff --git a/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj b/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj index 17250737..b9abbe77 100644 --- a/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj +++ b/src/DotNetty.Transport.Libuv/DotNetty.Transport.Libuv.csproj @@ -8,7 +8,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: libuv transport model Experimental en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 True diff --git a/src/DotNetty.Transport.Libuv/LoopExecutor.cs b/src/DotNetty.Transport.Libuv/LoopExecutor.cs index 3eef653e..69ffa8f2 100644 --- a/src/DotNetty.Transport.Libuv/LoopExecutor.cs +++ b/src/DotNetty.Transport.Libuv/LoopExecutor.cs @@ -80,7 +80,11 @@ public LoopExecutor(IEventLoopGroup parent, string threadName, TimeSpan breakout { name = $"{name}({threadName})"; } - this.thread = new Thread(Run) { Name = name }; + this.thread = new Thread(Run) + { + Name = name, + IsBackground = true + }; this.loopRunStart = new ManualResetEventSlim(false, 1); } diff --git a/src/DotNetty.Transport/DotNetty.Transport.csproj b/src/DotNetty.Transport/DotNetty.Transport.csproj index a2a4c226..6530c18d 100644 --- a/src/DotNetty.Transport/DotNetty.Transport.csproj +++ b/src/DotNetty.Transport/DotNetty.Transport.csproj @@ -8,7 +8,7 @@ © Microsoft Corporation. All rights reserved. DotNetty: transport model en-US - 0.7.1 + 0.7.2 Microsoft $(NoWarn);CS1591 false diff --git a/src/shared/SharedAssemblyInfo.cs b/src/shared/SharedAssemblyInfo.cs index 10c71f0b..ed949d62 100644 --- a/src/shared/SharedAssemblyInfo.cs +++ b/src/shared/SharedAssemblyInfo.cs @@ -7,7 +7,7 @@ [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("DotNetty")] -[assembly: AssemblyVersion("0.7.1")] -[assembly: AssemblyFileVersion("0.7.1")] +[assembly: AssemblyVersion("0.7.2")] +[assembly: AssemblyFileVersion("0.7.2")] [assembly: AssemblyCopyright("(c) Microsoft 2015 - 2021")] From 8bd7df64b15aaafec02e7c8fb607a7a7e0a94cd0 Mon Sep 17 00:00:00 2001 From: Andrey Ilnitsky Date: Mon, 14 Feb 2022 12:39:19 -0800 Subject: [PATCH 2/3] + code formatting --- src/DotNetty.Common/ThreadDeathWatcher.cs | 6 ++---- src/DotNetty.Common/Utilities/HashedWheelTimer.cs | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/DotNetty.Common/ThreadDeathWatcher.cs b/src/DotNetty.Common/ThreadDeathWatcher.cs index 7b3f736f..f043db77 100644 --- a/src/DotNetty.Common/ThreadDeathWatcher.cs +++ b/src/DotNetty.Common/ThreadDeathWatcher.cs @@ -59,10 +59,8 @@ static void Schedule(Thread thread, Action task, bool isWatch) if (Interlocked.CompareExchange(ref started, 1, 0) == 0) { - var watcherThread = new Thread(s => ((IRunnable)s).Run()) - { - IsBackground = true - }; + var watcherThread = new Thread(s => ((IRunnable)s).Run()); + watcherThread.IsBackground = true; watcherThread.Start(watcher); ThreadDeathWatcher.watcherThread = watcherThread; } diff --git a/src/DotNetty.Common/Utilities/HashedWheelTimer.cs b/src/DotNetty.Common/Utilities/HashedWheelTimer.cs index 2ecef70c..a1dd1378 100644 --- a/src/DotNetty.Common/Utilities/HashedWheelTimer.cs +++ b/src/DotNetty.Common/Utilities/HashedWheelTimer.cs @@ -98,10 +98,9 @@ public HashedWheelTimer( tickInterval, long.MaxValue / this.wheel.Length)); } - this.workerThread = new Thread(st => this.worker.Run()) - { - IsBackground = true - }; + + this.workerThread = new Thread(st => this.worker.Run()); + this.workerThread.IsBackground = true; this.maxPendingTimeouts = maxPendingTimeouts; From e3ec9cfa3736bb059b9b5b7bd3ec6e035792a54b Mon Sep 17 00:00:00 2001 From: Andrey Ilnitsky Date: Mon, 28 Feb 2022 17:44:56 -0800 Subject: [PATCH 3/3] Google.Protobuf 3.19.4 (latest) --- RELEASE_NOTES.md | 1 + src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ac647149..b99a9b86 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,6 @@ #### 0.7.2 February 14, 2022 - Start threads as background in HashedWheelTimer, LoopExecutor, ThreadDeathWatcher +- Google.Protobuf 3.19.4 (latest) #### 0.7.1 December 15, 2021 - Revert to use background threads diff --git a/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj b/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj index e8e7b3cc..4c4a6e2f 100644 --- a/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj +++ b/src/DotNetty.Codecs.Protobuf/DotNetty.Codecs.Protobuf.csproj @@ -34,6 +34,6 @@ - + \ No newline at end of file