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

zstd: pooledZipWriter should return Writers to the same pool #426

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

mostynb
Copy link
Contributor

@mostynb mostynb commented Aug 30, 2021

This code was previously Get'ing objects from one pool and later Put'ing them to a different pool, so they were never reused.

This code was previously Get'ing objects from one pool and later
Put'ing them to a different pool, so they were never reused.
@mostynb
Copy link
Contributor Author

mostynb commented Aug 30, 2021

Also, pooledZipReader seems to be unused because it leaks goroutines- would you be interested in merging something like https://github.com/mostynb/zstdpool-syncpool/blob/main/decoderpool.go (as an un-exported type)?

@klauspost
Copy link
Owner

@mostynb Nice! Thanks!

I don't want to rely on finalizers. I want to fix it properly, ie have a streaming option that only uses the main goroutine.

@mostynb
Copy link
Contributor Author

mostynb commented Aug 30, 2021

I don't want to rely on finalizers. I want to fix it properly, ie have a streaming option that only uses the main goroutine.

I agree that would be preferable. Is it worth commenting out pooledZipReader in the meantime, since it's unused?

@klauspost
Copy link
Owner

@mostynb It is fine to leave. Thanks for the contribution! I will include it in the release I will do shortly.

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