-
Notifications
You must be signed in to change notification settings - Fork 971
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 panic when reading and writing s.writer concurrently #4710
Conversation
polyrabbit
commented
Apr 16, 2024
Signed-off-by: Changxin Miao <[email protected]>
b2318de
to
7ac0c7c
Compare
pkg/vfs/writer.go
Outdated
@@ -120,7 +120,9 @@ func (s *sliceWriter) flushData() { | |||
s.writer.Abort() | |||
s.err = syscall.EIO | |||
} | |||
s.chunk.file.Lock() | |||
s.writer = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to remove this line
This could be introduced by #4694, which will start multiple gorotuine to prepare id, we should fix that also. |
Before #4694, I suppose it was also possible to spawn multiple goroutines to prepare one ID? |
it may spawn 2 goroutines when it crosss the 4M border. |
Signed-off-by: Changxin Miao <[email protected]> Co-authored-by: Davies Liu <[email protected]>
Signed-off-by: Changxin Miao <[email protected]> Co-authored-by: Davies Liu <[email protected]>