Do not protect an explicit Clear with a SemaphoreSlim#3751
Merged
Conversation
… scale, with clear requests queueing on busy producer endpoints; it was originally added before we had a global lock, to allow multiple clear operations to run, without creating a double publish. It is no longer needed and can be removed as a bottleneck
lillo42
approved these changes
Aug 27, 2025
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
dhickie
approved these changes
Aug 27, 2025
lillo42
approved these changes
Aug 27, 2025
DevJonny
pushed a commit
to DevJonny/Brighter
that referenced
this pull request
Feb 28, 2026
…d#3751) * fix: the semaphore used to protect an explicit clear causes issues at scale, with clear requests queueing on busy producer endpoints; it was originally added before we had a global lock, to allow multiple clear operations to run, without creating a double publish. It is no longer needed and can be removed as a bottleneck * fix: duplicate ADR numbering due to merge. * chore: add an ADR to describe the change * fix: file in wrong directory, fixed typo and amplified risk reasons.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SemaphoreSlim used to force Clear to be sequential prevents Brighter from scaling to meet demand at a rate faster than it takes to complete the Clear operation.
The SemaphoreSlim was initially added to prevent a dual publish, but we now have `IDisributedLock' for that. We can now remove that SemaphoreSlim and, along with it, the scaling limitation.
This work will need to be backported to V9 as well