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

Set dictionary ID in ZSTD_initCStream_usingCDict() #511

Merged
merged 1 commit into from
Jan 17, 2017

Conversation

indygreg
Copy link
Contributor

When porting python-zstandard to use ZSTD_initCStream_usingCDict()
so compression dictionaries could be reused, an automated test
failed due to compressed content changing.

I tracked this down to ZSTD_initCStream_usingCDict() not
setting the dictID field of the ZSTD_CCtx attached to the
ZSTD_CStream instance.

I'm not 100% convinced this is the correct or full solution,
as I'm still seeing one automated test failing with this change.

When porting python-zstandard to use ZSTD_initCStream_usingCDict()
so compression dictionaries could be reused, an automated test
failed due to compressed content changing.

I tracked this down to ZSTD_initCStream_usingCDict() not
setting the dictID field of the ZSTD_CCtx attached to the
ZSTD_CStream instance.

I'm not 100% convinced this is the correct or full solution,
as I'm still seeing one automated test failing with this change.
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@Cyan4973
Copy link
Contributor

Thanks for the patch @indygreg .
Looks like a genuine bug you discovered and fixed.

It will also be great to add a relevant test case, as this bug should have already been exposed. I'll take care of this part.

Our rules require CLA to be completed. This is a one-time process, you won't need to do it again for future patches.

Alternatively, should you prefer it, I can also manually push the same fix from my own clone.

@indygreg
Copy link
Contributor Author

The Facebook CLA tool is confused: when I go to complete the form, it tells me I've already registered my email address. I sent an email to Facebook, but my guess is I won't hear back until after the USA holiday today.

Sorry for no test case - I wasn't sure where/how to code that.

Go ahead and push the same fix from your clone if you want.

@Cyan4973
Copy link
Contributor

Sorry for your bad experience with the CLA process.
I'll try to get some help for you.

In parallel, I'll start developing a test case for this issue.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@JoelMarcey
Copy link

@indygreg Ok. The CLA issue should be resolved now. Sorry about that.

@Cyan4973
Copy link
Contributor

Cyan4973 commented Jan 17, 2017

I've added the test checking dictID in combination with ZSTD_initCStream_usingCDict().
It was non trivial, too difficult to expect an external contributor to create it.
And as expected, the test fails.

I'll push it to github, and then merge your patch.
Hopefully, it will show that your patch solves the issue.

@Cyan4973 Cyan4973 merged commit 123c8a3 into facebook:dev Jan 17, 2017
@Cyan4973
Copy link
Contributor

works great !

@Cyan4973 Cyan4973 mentioned this pull request Feb 6, 2017
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

4 participants