1

I am using ServiceStack.Redis version 4.0.56 to read and display Redis server information as shown in the class below:

using ServiceStack.Redis

class Test
{
    private IRedisClientManager clientManager;

    public Test()
    {
        clientManager = new PooledRedisClientManager(10, 10, connectionString);
    }

    public IDictionary<string, string> GetInfo()
    {
         var redisClient = redisClientManager.GetClient();
         var info = redisClient.Info;

         // If commented out, all info values are updated (i.e. uptime, keys etc)
         redisClient.Dispose();

         return info;
    }
}

The problem is, as soon as the client is disposed (per best-practice), the Info property of redisClient always returns the old values, even though I obtain a new client instance as shown in the GetInfo method above.

When I leave out the redisClient.Dispose call, the Info values are all updated.

What am I doing wrong? Thanks!

Genti Saliu
  • 2,643
  • 4
  • 23
  • 43

1 Answers1

1

After posting this as an issue in Github, the ServiceStack team members were quick to respond.

The reason was that the RedisClient caches the INFO command and does not update data on subsequent calls or after disposing and using it with the client manager.

This has been fixed in ServiceStack.Redis v4.0.59.

Genti Saliu
  • 2,643
  • 4
  • 23
  • 43