Skip to content

use sync.Once to protect racy selct-base chan closes - #286

Merged
scott-cotton merged 4 commits into
mainfrom
fix-racy-closes
Dec 11, 2025
Merged

scott-cotton merged 4 commits into
mainfrom
fix-racy-closes

Conversation

@scott-cotton

Copy link
Copy Markdown
Member

No description provided.

Comment on lines +63 to +67
select {
case <-lfs.closeCh:
default:
close(lfs.closeCh)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why this instead of just close(lfs.closeCh)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

please see a66d0b7

@daniel-de-vera daniel-de-vera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@scott-cotton
scott-cotton merged commit 221f819 into main Dec 11, 2025
@scott-cotton
scott-cotton deleted the fix-racy-closes branch December 11, 2025 13:03
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