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

messager: avoid taking locks if there's no work to do #4745

Merged
merged 1 commit into from
Mar 31, 2019

Conversation

demmer
Copy link
Member

@demmer demmer commented Mar 22, 2019

In reviewing #4739 I noticed that the txpool calls into the messager engine on every committed transaction with the list of new messages / changed messages.

For all cases in which the transaction did not actually change a messages table, the two lists are empty, but the messager engine still takes internal locks to process these empty lists.

It seems like this could cause unnecessary lock contention, so add an initial short-circuit check in case both lists are empty.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
@demmer demmer requested a review from sougou as a code owner March 22, 2019 15:58
@sougou sougou merged commit 3ece871 into vitessio:master Mar 31, 2019
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