v2.5 Backlog: Use AutoResetEvent for backlog thread lingering by NickCraver · Pull Request #2008 · StackExchange/StackExchange.Redis
NickCraver
changed the title
v2.5 Backlog: Use Autoreset for backlog thread lingering
v2.5 Backlog: Use AutoResetEvent for backlog thread lingering
NickCraver added a commit that referenced this pull request
Feb 24, 2022A few tweaks to the changes #2008 for disposing and normalization.
NickCraver added a commit that referenced this pull request
Feb 24, 2022A few tweaks to the changes #2008 for disposing and normalization.
NickCraver added a commit that referenced this pull request
Feb 26, 2022Alrighty, #2008 did something exceedingly stupid: it lingered *inside the lock*, jamming the connection and backlog during linger. Instead, this moves the thread preservation up in a much cleaner way and doesn't occupy the lock. Also adds a SpinningDown status so we can see it proper in exceptions, always.
NickCraver added a commit that referenced this pull request
Feb 26, 2022In troubleshooting these 2 tests, I realized what's happening: a really dumb placement mistake in #2008. Now, instead of locking inside the damn lock, it loops outside a bit cleaner and higher up. Performance wins are the same but it's a lot sander and doesn't block both the backlog and the writer for another 5 seconds. Now only the thread lingers and it'll try to get the lock when running another pass, if it gets any in the next 5 seconds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters