Skip to content

Do not protect an explicit Clear with a SemaphoreSlim#3751

Merged
iancooper merged 4 commits into
masterfrom
clear_block
Aug 27, 2025
Merged

Do not protect an explicit Clear with a SemaphoreSlim#3751
iancooper merged 4 commits into
masterfrom
clear_block

Conversation

@iancooper

Copy link
Copy Markdown
Member

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

… 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
@iancooper iancooper self-assigned this Aug 27, 2025
@iancooper iancooper added 3 - Done v9 Required for v9 release .NET Pull requests that update .net code Performance Improvement V10.X labels Aug 27, 2025
codescene-delta-analysis[bot]

This comment was marked as outdated.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@iancooper iancooper merged commit 4e13e53 into master Aug 27, 2025
43 of 44 checks passed
@iancooper iancooper deleted the clear_block branch August 28, 2025 19:03
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Done .NET Pull requests that update .net code Performance Improvement v9 Required for v9 release V10.X

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants