Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tea): allocate msgs channel in constructor #180

Merged
merged 1 commit into from Jan 14, 2022

Conversation

paralin
Copy link
Contributor

@paralin paralin commented Jan 4, 2022

Race condition bug: Start() is called in a new gorotuine, then Send(). If the Send happens before the msgs channel is allocated, the message is dropped.

Instead allocate the channel in the constructor, so msgs is never nil.

Race condition bug: Start() is called in a new gorotuine, then Send(). If the
Send happens before the msgs channel is allocated, the message is dropped.

Instead allocate the channel in the constructor, so msgs is never nil.

Signed-off-by: Christian Stewart <christian@paral.in>
@meowgorithm meowgorithm added the bug Something isn't working label Jan 11, 2022
@meowgorithm
Copy link
Member

Looks good and makes sense. Thanks for the fix!

@meowgorithm meowgorithm merged commit 608fde5 into charmbracelet:master Jan 14, 2022
@paralin paralin deleted the fix-msgs branch January 14, 2022 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants