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 data race on streaming client close #173

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

emcfarlane
Copy link
Contributor

@emcfarlane emcfarlane commented Jun 3, 2024

Fix a data race for a streaming client on close when a the context is cancelled. This was introduced in #152 where we changed the behaviour to trigger a close on context cancellation. The state must be locked to avoid a data race with Send/Receive calls.

Closes #170, #171.

Ensure we lock the state to handle context cancellation closes.

Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
@emcfarlane emcfarlane marked this pull request as ready for review June 3, 2024 17:52
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
@akshayjshah akshayjshah merged commit b4b0af3 into connectrpc:main Jun 24, 2024
4 checks passed
@emcfarlane emcfarlane deleted the ed/fixStreamingClientClose branch June 24, 2024 22:39
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.

Data Race: Closing a stream accesses streamingState data without acquiring a lock
3 participants