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

Fix copylock when use sync.Pool in clickhouse.Pool #724

Merged
merged 1 commit into from
Aug 21, 2022

Conversation

fengberlin
Copy link
Contributor

@fengberlin fengberlin commented Aug 19, 2022

In the conn_http.go, line 48, the clickhouse.Pool contains a sync.Pool, but according to sync.Pool doc:

A Pool must not be copied after first use

That is because sync.Pool contains noCopy. So to avoid copied after use, we should wrap a *sync.Pool in clickhouse.Pool:

type Pool[T any] struct {
    pool *sync.Pool
}

@CLAassistant
Copy link

CLAassistant commented Aug 19, 2022

CLA assistant check
All committers have signed the CLA.

@gingerwizard gingerwizard merged commit 78ecf43 into ClickHouse:main Aug 21, 2022
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.

3 participants