-
Notifications
You must be signed in to change notification settings - Fork 282
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
worker(dm): fix Server Start/Close race (#6213) #6292
worker(dm): fix Server Start/Close race (#6213) #6292
Conversation
Signed-off-by: lance6716 <lance6716@gmail.com>
This reverts commit 0a7a73c.
This reverts commit 0cb9729.
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Co-authored-by: D3Hunter <jujj603@gmail.com>
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## release-6.1 #6292 +/- ##
================================================
Coverage ? 56.5524%
================================================
Files ? 532
Lines ? 70241
Branches ? 0
================================================
Hits ? 39723
Misses ? 26744
Partials ? 3774 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: ff8a4f2
|
This is an automated cherry-pick of #6213
Signed-off-by: lance6716 lance6716@gmail.com
What problem does this PR solve?
Issue Number: close #5836 close #5089
What is changed and how it works?
for #5836 : Server.Start is blocking, so before it we must spawn a goroutine to watch terminate signal. Original in that goroutine we call Server.Close, but Start/Close is not concurrent-safe. Now we use context to do cancellation.
for #5089 : when worker Server is about to close, it will hold the lock, enter doClose, then blocked on waitgroup
tiflow/dm/dm/worker/server.go
Lines 438 to 439 in 9bce8cc
but other goroutine may in the same time stuck at
s.Lock
.Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note