AsyncTargetWrapper - LogEventDropped and EventQueueGrow events fixes#5883
AsyncTargetWrapper - LogEventDropped and EventQueueGrow events fixes#5883snakefoot merged 9 commits intoNLog:masterfrom
Conversation
…Grow event args (request queues should increase theirs limit before invoking the event)
…han once under concurrent load added unit-test to illustrate the problem and to make sure it's fixed
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
tests/NLog.UnitTests/Targets/Wrappers/CommonRequestQueueTests.cs
Outdated
Show resolved
Hide resolved
tests/NLog.UnitTests/Targets/Wrappers/CommonRequestQueueTests.cs
Outdated
Show resolved
Hide resolved
|
Thank you so much for reporting this, and also providing a nice pull-request with unit-tests. I have some small nitpicks, but I don't mind making the fixes myself, if you don't have the time. |
tests for unsubscription also added
snakefoot
left a comment
There was a problem hiding this comment.
Looks great. Thank you for fixing the nitpicks. Much appreciated.
|
|
Hooray your first pull request is merged! Thanks for the contribution! Looking for more? 👼 Please check the up-for-grabs issues - thanks! |




Problems fixed:
EventQueueGrowevent, subscribing forLogEventDroppedhad no effect (wrong field was being checked for null)EventQueueGrowreported old queue size despite parameter nameLogEventQueueGrowEventArgs.NewQueueSize. Fixed that by doublingRequestLimitfirst, then invoking the eventConcurrentRequestQueuecould erroneously multiply itsRequestLimitmore than once when hitting current limit under concurrent load because of a race conditionImprovements:
OnLogEventDroppedandOnLogEventQueueGrowsunit-tests forConcurrentRequestQueueandAsyncRequestQueue- they should behave the sameRequestLimitrace inConcurrentRequestQueue