Skip to content

fix: resolve data race between followerCursor.Close() and stream.Send()#946

Merged
merlimat merged 1 commit intooxia-db:mainfrom
merlimat:fix-follower-cursor-race
Mar 11, 2026
Merged

fix: resolve data race between followerCursor.Close() and stream.Send()#946
merlimat merged 1 commit intooxia-db:mainfrom
merlimat:fix-follower-cursor-race

Conversation

@merlimat
Copy link
Copy Markdown
Collaborator

Close() was calling stream.CloseSend() concurrently with streamEntriesLoop() calling stream.Send() on the same gRPC stream. The cancel() call already terminates the stream by cancelling the context, so the explicit CloseSend() is unnecessary and racy.

Close() was calling stream.CloseSend() concurrently with
streamEntriesLoop() calling stream.Send() on the same gRPC stream.
The cancel() call already terminates the stream by cancelling the
context, so the explicit CloseSend() is unnecessary and racy.

Signed-off-by: Matteo Merli <mmerli@apache.org>
@merlimat merlimat merged commit 4a33afe into oxia-db:main Mar 11, 2026
5 checks passed
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.

1 participant