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

blob/s3blob: fix data race #3480

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
s3blob: fix data race
w.pr cannot be used to indicate that the pipe has been closed. The problem with
using w.pr is that a write to it in the goroutine launched by writer.open can
race with a read on w.pr in Close.

We just don't write to w.pr in writer.open. The read end of the pipe can still be
closed twice, but that's fine.
  • Loading branch information
arjunnair1997 committed Aug 29, 2024
commit 08ff5df777de3286040ca75cb34909aa4252046a
1 change: 0 additions & 1 deletion blob/s3blob/s3blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ func (w *writer) open(r io.Reader, closePipeOnError bool) {
if err != nil {
if closePipeOnError {
w.pr.CloseWithError(err)
w.pr = nil
}
w.err = err
}
Expand Down
Loading