Repository navigation
Fix RedisCluster multi-key argument ownership - #2954
Open
ebubekiryigit wants to merge 3 commits into
Open
ebubekiryigit wants to merge 3 commits into
ebubekiryigit wants to merge 3 commits into
Conversation
Convert borrowed key arguments into owned strings without modifying callers. Release temporary keys and handle conversion exceptions before dispatch. Add regressions for shared arrays, stringable arguments, integer-key allocations, prefixes and conversion failures.
Normalize array and variadic keys into an owned string table before sending or queueing any slot batch. Conversion errors can no longer leave partially executed deletes or dangling MULTI reply contexts. Add regressions for cross-slot conversion errors, warning behavior, empty arrays, and caller-owned references.
Capture both E_NOTICE and E_WARNING when checking array-key coercion. PHP 7.4 emits a notice, while PHP 8 emits a warning.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RedisCluster converts MGET, DEL and UNLINK keys in caller-owned values. This can modify input arrays and references, leak converted variadic keys, and release stringable objects too early. Modifying OPcache-protected literal arrays can also crash PHP.
Convert all keys into an owned string table before sending or queueing any slot batch, and release temporary allocations on every exit path.
If conversion throws, no part of that command is dispatched and existing MULTI entries remain intact. Ordinary conversion warnings retain their behavior; warnings promoted to exceptions now abort before dispatch. Successful command results, prefix handling and slot routing are unchanged.
Regression tests cover shared arrays, references, stringable object lifetime, integer-key allocations, prefixes, empty arrays, and conversion failures after keys from different slots.
Validation: