Hi,
We have a problem with ServiceStack Redis which sometime it thows Exception
"ServiceStack.Redis.RedisResponseException: Unknown reply on integer response: 123"ChannelId":154258,"ChannelType":3,"ChannelBranch":49296,"RetailerId":686325,"BasePriceBookId":0,"Id":240528,"NextRun":"\/Date(1597277234486+0700)\/","LastSync":"\/Date(1597985428021+0700)\/","IsRunning":true,"Type":1}
at ServiceStack.Redis.RedisNativeClient.ReadLong()
at ServiceStack.Redis.RedisNativeClient.SendReceive[T](Byte[][] cmdWithBinaryArgs, Func`1 fn, Action`1 completePipelineFn, Boolean sendWithoutRead)
at ServiceStack.Redis.RedisClient.RegisterTypeId(String typeIdsSetKey, String id)
at ServiceStack.Redis.Generic.RedisTypedClient`1.Store(T entity)
at KiotViet.OmniChannel.ScheduleService.Impls.ScheduleService.AddOrUpdate(Byte channelType, Byte scheduleType, ScheduleDto dto, Boolean isUpdateLastSync) in /src/Shared/xxx.OmniChannel.ScheduleService/Impls/ScheduleService.cs:line 149"
The code is below
method AddOrUpdate
GetById method
public T GetById(object id, IRedisTypedClient<T> client)
{
return client.GetById(id);
}
AddOrUpdate method
public virtual void AddOrUpdate(T t, IRedisTypedClient<T> client)
{
client.Store(t);
}
AddItemToSet method
public void AddItemToSet(string key, string value, IRedisClient redisClient)
{
if (!redisClient.SetContainsItem(key, value))
redisClient.AddItemToSet(key, value);
}
ClientManager is an IRedisClientsManager which is thread safe
protected IRedisClientsManager ClientsManager;
The Exception seems happen due to use RedisClient in multiple threads. However look at the code it is not possible though
Please help me on this. we get quite a lot of this issue on our production.