You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there seems to be a bug in client-side caching support when handling hash READ operations that specify field(s), such as HGET and HMGET.
current implementation only stores redis_keys and not hash field names, so the cache entry is shared for different field combinations and end up returning the wrong value.
it's easy to reproduce:
import redis
from redis.cache import CacheConfig
url = 'xxx'
key = 'abcde'
r = redis.from_url(url, protocol=3, cache_config=CacheConfig())
r1 = redis.from_url(url)
r1.hset(key, mapping={'field1': 'aaa', 'field2': 'bbb'})
print(r.hget(key, 'field1')) # prints 'aaa'
print(r.hget(key, 'field2')) # should print 'bbb', but uses the cache entry created in previous line and prints 'aaa'
The text was updated successfully, but these errors were encountered:
there seems to be a bug in client-side caching support when handling hash READ operations that specify field(s), such as HGET and HMGET.
current implementation only stores
redis_keys
and not hash field names, so the cache entry is shared for different field combinations and end up returning the wrong value.it's easy to reproduce:
The text was updated successfully, but these errors were encountered: