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 deadlock for filer upload #4527

Merged
merged 1 commit into from
Jun 3, 2023

Conversation

wusongANKANG
Copy link
Contributor

What problem are we solving?

fix #4526

Analysis

The main goroutine enters the loop and checks the condition atomic.LoadInt64(&bytesBufferCounter) >= 4. lf this condition is true,it waits on bytesBufferLimitCond.Wait().This will block the main goroutine until another goroutine calls bytesBufferLimitCond.Signal()

lf all the worker goroutines have finished their work and exited, there will be no more calls to "bytesBufferLimitCond.Signal().This means the main goroutine will wait indefinitely, leading to a deadlock

How are we solving the problem?

We use channels to throttle

How is the PR tested?

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

Signed-off-by: wang wusong <wangwusong@virtaitech.com>
@chrislusf chrislusf merged commit 5aec6da into seaweedfs:master Jun 3, 2023
5 checks passed
kmlebedev pushed a commit to kmlebedev/seaweedfs that referenced this pull request Dec 22, 2023
Signed-off-by: wang wusong <wangwusong@virtaitech.com>
Co-authored-by: wang wusong <wangwusong@virtaitech.com>
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.

deadlock when uploading files through filer.
2 participants