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

Memory Sort to close the goroutines when callback returns error #7903

Merged
merged 3 commits into from
Apr 22, 2021

Conversation

harshit-gangal
Copy link
Member

@harshit-gangal harshit-gangal commented Apr 20, 2021

Fixes #7908

Description

Merge sort is used when VTGate needs to merge the incoming sorted streams. The Bug was around if the callback returns and go routines that are handling those streams needs to be closed.
This is usually achieved by using cancellable context. The new context that was created was not passed to those goroutines so even the context was cancelled the goroutines were stuck waiting.

Checklist

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

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving

systay and others added 3 commits April 20, 2021 18:16
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal harshit-gangal marked this pull request as ready for review April 21, 2021 07:42
@systay systay merged commit ae3c297 into vitessio:master Apr 22, 2021
@systay systay deleted the stream-ms-fix branch April 22, 2021 09:54
systay added a commit to planetscale/vitess that referenced this pull request Apr 22, 2021
* make sure to close the right context when done
* added some sleep to wait for goroutines to close
* change test expectation from equal to actual being less than or equal

Fixes vitessio#7908

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
deepthi added a commit that referenced this pull request Apr 22, 2021
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.

Certain queries get hung and never release their slot in the streaming pool
3 participants