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

Backport #9833: Check if context is cancelled in applyEvents() loop to avoid deadlocks #10036

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

rohit-nayak-ps
Copy link
Contributor

Description

There is a code-path in applyEvents() in vplayer.go where it waits on a throttler check and sleeps if it is determined that a wait is needed. If the context is cancelled here then it can loop infinitely. The vreplication controller tries to shutdown due to the context failure, but it waits for all streams to end. This results in a deadlock.

This PR checks for a context cancellation in between throttle checks.

Related Issue(s)

Original PR: #9833
#9827

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

… on vreplication controller shutdown

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@deepthi deepthi merged commit 1578e0d into vitessio:release-13.0 Apr 4, 2022
@deepthi deepthi deleted the backport-9833 branch April 4, 2022 22:08
@frouioui frouioui mentioned this pull request Apr 7, 2022
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants