Skip to content

schedule: fix a deadlock in GetOpInfluence#1340

Merged
disksing merged 3 commits into
tikv:masterfrom
rleungx:fix-dead-lock
Nov 22, 2018
Merged

schedule: fix a deadlock in GetOpInfluence#1340
disksing merged 3 commits into
tikv:masterfrom
rleungx:fix-dead-lock

Conversation

@rleungx
Copy link
Copy Markdown
Member

@rleungx rleungx commented Nov 22, 2018

What problem does this PR solve?

#1310 changes the logic when getting OpInfluence and use GetOperator in GetOpInfluence. These two functions both add RLock which might cause a deadlock.

What is changed and how it works?

This PR uses oc.operators directly rather than call GetOperator in GetOpInfluence. Closes #1338.

Check List

Tests

  • Unit test

@rleungx rleungx added the type/bug The issue is confirmed as a bug. label Nov 22, 2018
@rleungx rleungx requested review from disksing and nolouch November 22, 2018 09:27
oc.GetOpInfluence(tc)
}
}()
time.Sleep(1 * time.Second)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't sleep. Use waitGroup to save test time.

@rleungx rleungx added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 22, 2018
@rleungx rleungx removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 22, 2018
@disksing disksing merged commit 0f89ea6 into tikv:master Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug The issue is confirmed as a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants