[5.6] Add missing phpredis connection parameters to PhpRedisConnector. #24678
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.
At the moment, not all of the connection options are supported for phpredis. Namely, the
persistent_id
parameter forpconnect
and thereserved
andretry_interval
parameters forconnect
are missing.The
persistent_id
parameter is particularly useful, since multiple connections will use the previous state of the connection, including any options passed viasetOption
andselect
operations. Configuring multiple connections with differentpersistent_id
values isolates these.This PR adds support for the 3 missing parameters in their respective cases via config options.
This doesn't break any backwards compatibility. The order of the parameters has not changed and the additional parameters are added with the defaults from phpredis code. Any previous connections to Redis will remain the same, unless the new parameters are configured.
Note: I suspect Travis is running an old version of Redis, which doesn't support persistent connections. Should this be upgraded or the added
it_persists_connection
test be removed?References: