When a client initiates the deletion of a key, and that key is cached by the client, the cache should be invalidated to prevent retaining invalid data.
Actual behavior
cache is not affected, attempting to get a cached value after its deletion returns it
Steps to reproduce:
run the following unit test:
@Test
public void test(){
JedisClientConfig clientConfig = DefaultJedisClientConfig.builder()
.resp3()
.build();
ClientSideCache clientSideCache =
GuavaClientSideCache.builder().maximumSize(1000).build();
UnifiedJedis jedis = new UnifiedJedis(new HostAndPort("127.0.0.1", 6379),
clientConfig,clientSideCache);
jedis.set("myKey","myValue");
jedis.get("myKey"); // cache miss
jedis.get("myKey"); // cache hit
jedis.del("myKey");
Assertions.assertNull(jedis.get("myKey"));
}
Expected behavior
When a client initiates the deletion of a key, and that key is cached by the client, the cache should be invalidated to prevent retaining invalid data.
Actual behavior
cache is not affected, attempting to get a cached value after its deletion returns it
Steps to reproduce:
run the following unit test:
Jedis version:
5.2.0-beta1