-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Stop defaulting to igbinary
in DefaultMarshaller
#57702
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
This comment was marked as resolved.
This comment was marked as resolved.
Changing the default behavior silently in a bugfix release on an LTS branch sounds like a bad idea, tbh. If we want to do this, we should target 7.2 and deprecate not setting this option first. |
The code is able to auto-detect if igbinary was used when serializing so that payloads are compatible with either flags (if igbinary is installed). |
DefaultMarshaller
igbinary
in DefaultMarshaller
I am not convinced that this is always true. What if other PHP projects not using Symfony read the serialised data? They may not have the same mechanism to detect if igbinary was used. |
This would be an unsupported use case. Cached items are certainly not meant for interop. We already changed their format without caring in the past. This change is desired to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me on 7.2. I'd also be fine on 5.4/6.4: igbinary is not safe anymore, ppl are at risk when using it, and the fact that it's not opt-in when the extension is installed adds to the risk.
See eg comments in igbinary/igbinary#273 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for 5.4
I think, 7.2 is the compromise we can all settle on. And please let's add a remark to the upgrade guide for 7.2 and the Cache component's change log.
I understand that and maybe it was even a mistake to enable igbinary serialization automatically. But I believe that there are enough projects out there that don't hit those issues and still rely on the performance gain they get from leveraging igbinary. Maybe I'm too conservative here, but I wouldn't want to lure those apps into a performance degradation with an innocent bugfix release. |
igbinary used to be a drop in replacement for PHP's `serialize` but recent changes (in PHP 7.4) to the handling of uninitialized properties in `serialize` have not made it into igbinary, so it no longer is a simple drop in replacement. This only removes igbinary as the default serializer, code can still opt-in through the first constructor argument. This may result in a performance regression on systems with igbinary as it would no longer be used by default.
Thank you @martijnc. |
igbinary used to be a drop in replacement for PHP's
serialize
but recent changes (in PHP 7.4) to the handling of uninitialized properties inserialize
have not made it into igbinary, so it no longer is a simple drop in replacement.This only removes igbinary as the default serializer, code can still opt-in through the first constructor argument.
This may result in a performance regression on systems with igbinary as it would no longer be used by default.
Fixes #52391