New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async / buffering wrapper: Improve performance when blocking on NetCore #3416
Async / buffering wrapper: Improve performance when blocking on NetCore #3416
Conversation
d29f47d
to
9a19a71
Compare
9a19a71
to
d1757b9
Compare
Codecov Report
@@ Coverage Diff @@
## release/4.6.4 #3416 +/- ##
==============================================
- Coverage 80% 80% -<1%
==============================================
Files 358 358
Lines 28373 28378 +5
Branches 3785 3784 -1
==============================================
- Hits 22750 22740 -10
- Misses 4537 4543 +6
- Partials 1086 1095 +9 |
7b6a5a3
to
d59e833
Compare
tests/NLog.UnitTests/Targets/Wrappers/AsyncTargetWrapperTests.cs
Outdated
Show resolved
Hide resolved
tests/NLog.UnitTests/Targets/Wrappers/AsyncTargetWrapperTests.cs
Outdated
Show resolved
Hide resolved
d59e833
to
b5a01ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
b5a01ed
to
c0f2c3f
Compare
Apparently hard to make a stable unit-test with multi-threading on the build-engines. One more try. |
48d12d4
to
721177a
Compare
Hrmm. Don't like how the NetCoreApp2 unit test have become very unstable. Need to be checked. |
6a9b524
to
995a478
Compare
Yes please check. Unstable tests are really slowing down development and releases. Maybe we should partly mock the unit test. |
It's probably now more an integration test, like most "unit tests" in NLog. |
d1d93b3
to
70062ce
Compare
Actually think it is a real bug, that has been revealed by the optimization of the dequeue-operation for the timer-thread. But right now the appveyor-build-queue has become very long, so it will have to look at it another day. |
70062ce
to
3c4cddf
Compare
Maybe it's easier to run only on your appveyor account for this? Then you could stop/restart it yourself See https://github.com/NLog/NLog/blob/dev/howto-build-your-fork.md |
d23a6fe
to
d9f2cc4
Compare
Think I have found the bug. After we have changed so blocking decrement/increments, then it means that timer-thread no longer automatically reschedules itself because it will not "see" producers by non-zero _count. It is important now that the producers that wake up will remember to start the consumer-timer-thread, if needed. Two producers that are blocked will get into This causes both producers to say that they don't need to start the consumer-timer-thread |
…ing mode (And unit test for deadlock issue)
d9f2cc4
to
7d65677
Compare
makes sense! Thanks for figuring out and fixing this! |
ConcurrentRequestQueue - Improved DequeueBatch performance when blocking
Avoid activating throttle logic, when timer-thread is able to keep up. The throttle logic also affects the timer-thread, so only perform throttle-logic when timer-thread is falling behind.
And unit test for deadlock issue