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

bind the goroutine pool with store and close on Close #645

Merged
merged 4 commits into from
Dec 26, 2022

Conversation

tiancaiamao
Copy link
Contributor

Fix tidb CI

image

Signed-off-by: tiancaiamao tiancaiamao@gmail.com

Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
@tiancaiamao
Copy link
Contributor Author

PTAL @sticnarf @hehechen

Comment on lines 1015 to 1019
if gP, ok := c.store.(interface{ Go(func()) }); ok {
gP.Go(f)
} else {
go f()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can imagine the goroutine pool could be used elsewhere. Then, this snippet may be repeated.

So, do you think it acceptable to make Go(func()) a function inside of kvstore? Indeed, this seems a bit strange considering the interface name is kvstore. But kvstore is a private interface, so it will have less worse influence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
@sticnarf sticnarf merged commit 018c59d into tikv:master Dec 26, 2022
hawkingrei pushed a commit to hawkingrei/client-go that referenced this pull request Feb 24, 2023
Signed-off-by: tiancaiamao <tiancaiamao@gmail.com>
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