Skip to content

Fix data race in PlaybackStream #40

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

Merged
merged 8 commits into from
Feb 27, 2025

Conversation

ftl
Copy link
Contributor

@ftl ftl commented Feb 27, 2025

The state field of PlaybackStream is used concurrently in different go routines. This leads to random race conditions that result in panics in the worst case. See https://github.com/ftl/faultdemo to reproduce the problem. It plays morse code in an endless loop and usually panics within one minute (please be patient - and turn down your volume).

This change defines the new stateMachine type, which synchronizes the read and write access to the state of the PlaybackStream.

ftl added 8 commits February 25, 2025 18:55
@jfreymuth jfreymuth merged commit 7a016f9 into jfreymuth:master Feb 27, 2025
1 check passed
@ftl ftl deleted the fix-playback-datarace branch February 28, 2025 11:27
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