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

VReplicationExec: don't create new stats objects on a select #8166

Merged
merged 1 commit into from
May 23, 2021

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented May 20, 2021

Description

With a recent change we ended up creating a new stats object for every call to VReplicationExec, as part of creating a new VDBClient. However each stats object also creates a goroutine which never gets cleaned up. In PSDB there is a monitoring call to get a list of all workflows every few seconds. This creates resource starvation due to the number of orphan goroutines that keep running.

This PR fixes this immediate problem by only creating the VDBClient on insert/update/delete and not select.

In the long term we need to cleanup the goroutines for stats objects that are no longer in scope.

Related Issues

#7818

…update and not for select since NewStats() creates a new goroutine which is never cleaned up at the moment

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@deepthi deepthi merged commit dff8d63 into vitessio:master May 23, 2021
@deepthi deepthi deleted the rn-vrexec-stats branch May 23, 2021 21:08
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.

None yet

2 participants