Skip to content

fix: guard errorWindow count access in String - #5775

Open
reheptin wants to merge 1 commit into
zeromicro:masterfrom
reheptin:patch-2
Open

reheptin wants to merge 1 commit into
zeromicro:masterfrom
reheptin:patch-2

Conversation

@reheptin

@reheptin reheptin commented Sep 8, 2026

Copy link
Copy Markdown

Acquire the errorWindow mutex before reading ew.count to avoid a data race with concurrent add operations.

The previous implementation used ew.count to size the reasons slice before acquiring the lock, allowing String and add to access ew.count concurrently under load.

Acquire the errorWindow mutex before reading ew.count to avoid a data race with concurrent add operations.

The previous implementation used ew.count to size the reasons slice before acquiring the lock, allowing String and add to access ew.count concurrently under load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant