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

sync: wait() may miss signal then cause deadlock #3782

Merged
merged 2 commits into from
Jun 8, 2023
Merged

Conversation

davies
Copy link
Contributor

@davies davies commented Jun 7, 2023

There is a chance that Wait() may miss the signal from Signal(), then deadlock, we should always use WaitWithTimeout().

G1                        G2

read is false
Unlock
                            Lock
                            ready = true
                            select ch {
                            default:
                            }
<- ch (deadlock)

@davies davies requested a review from SandyXSD June 7, 2023 15:37
@davies davies changed the title Wait() may miss signal then deadlock sync: wait() may miss signal then cause deadlock Jun 7, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

Mutate Test Report
pkg/utils/cond_test.go-1-1: score:0.57 failed:3, passed:4, compile error:0, out of coverage:0, skip by comment:0, others:0
Job detail: https://github.com/juicedata/juicefs/actions/runs/5201968086/jobs/9382904152

Usage: https://github.com/juicedata/juicefs/blob/main/.github/scripts/mutate/how_to_use_mutate_test.md

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Mutate Test Report
pkg/utils/cond_test.go-1-1: score:0.57 failed:3, passed:4, compile error:0, out of coverage:0, skip by comment:0, others:0
Job detail: https://github.com/juicedata/juicefs/actions/runs/5207073993/jobs/9394279542

Usage: https://github.com/juicedata/juicefs/blob/main/.github/scripts/mutate/how_to_use_mutate_test.md

@SandyXSD SandyXSD merged commit 9988110 into main Jun 8, 2023
@SandyXSD SandyXSD deleted the fix_deadlock2 branch June 8, 2023 03:58
@SandyXSD SandyXSD mentioned this pull request Jun 8, 2023
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.

2 participants