Skip to content

Upgrade Redis gem to 4.8.0

Heinrich Lee Yu requested to merge upgrade-redis-4-8-0 into master

What does this MR do and why?

This upgrade adds deprecations to help us transition to redis-rb 5.0: https://github.com/redis/redis-rb/pull/1134/files

https://my.diffend.io/gems/redis/4.7.1/4.8.0

https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#480

There are multiple ways to address the deprecation for sadd / srem:

  1. We could just set Redis.sadd_returns_boolean = false so that we switch to the new redis-rb 5.0 behavior. All of the usages I found in our codebase don't really care about the return value so in theory this should work. This is riskier though because there could be some gems that depend on these commands returning booleans.

  2. Change calls that pass a non-array value to use sadd? / srem?. This prevents the deprecation message and keeps the old behavior.

  3. Change calls that pass a non-array value to pass an array instead. Passing an array always returns an integer (the number of members added / removed). This is similar to 1 but only affects the calls that we change.

I went with a combination of 2 and 3 because it's less risky. This gives us time to see if there are any deprecated usage in gems. In some places I used approach 3 because we were already looping over an array and it would be more efficient to use a single command. The return value isn't being used anyway so it should work the same way.

Regarding the timeout deprecation, I don't see any usage of this in this repo.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports