Bug: Subscriber client crash when listen to 'redis:invalidate' messages queue. (original) (raw)
Found in :
https://github.com/StackExchange/StackExchange.Redis/issues/1461
Redis ver 6.2.6 (on docker's container)
Stackexchange ver : 2.2.79 / 2.5.61 ( on dotnet core 3.1 )
Lets say we have a subscriber for invalidate keys queue : (to implement near cache)
var subscriber = invalidator.GetSubscriber();
subscriber.Subscribe(" _ _ redis _ _ :invalidate").OnMessage(message =>
{
Console.WriteLine($"redis:invalidate: {message}");
});
We never get messages came from values changes or expired (we do get messages came from explicit publish call.)
When looking deeper we can see that the client id of the subscriber change after setting new values of tracking keys.. meaning it's was crash..
I got this : System.InvalidCastException: 'Cannot convert to RedisValue: MultiBulk' .
in this method :
Internal RedisValue AsRedisValue()