Skip to content

Clear buffers under lock#526

Merged
bitfaster merged 2 commits into
mainfrom
users/alexpeck/fixclear
Dec 4, 2023
Merged

Clear buffers under lock#526
bitfaster merged 2 commits into
mainfrom
users/alexpeck/fixclear

Conversation

@bitfaster

@bitfaster bitfaster commented Dec 4, 2023

Copy link
Copy Markdown
Owner

The read and write buffer are both mp-sc (single consumer) - it is only valid for 1 thread to deque. Prior change switched from Clear allocating a new buffer to TryTake until empty.

Clearing the buffers must be protected by the maintenance lock, otherwise two threads can effectively dequeue - this situation is provoked by a test causing the build to hang intermittently.

@coveralls

coveralls commented Dec 4, 2023

Copy link
Copy Markdown

Coverage Status

coverage: 99.178% (-0.06%) from 99.237%
when pulling 28121ca on users/alexpeck/fixclear
into 4201887 on main.

@bitfaster bitfaster marked this pull request as ready for review December 4, 2023 02:58
@bitfaster bitfaster merged commit dad77db into main Dec 4, 2023
@bitfaster bitfaster deleted the users/alexpeck/fixclear branch December 4, 2023 02:58
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.

2 participants