On a Windows Service with selfhosting
ServiceStack 5.0.2
Thre is Service that is cached with [CacheResponse(Duration = 5)]
that transform data from another Service that has [CacheResponse(Duration = 3)]
2018-06-08 10:43:53,438 ERROR [80] ServiceStack.ServiceStackHost - ServiceBase<TRequest>::Service Exception
ServiceStack.Redis.RedisResponseException: Zero length response
at ServiceStack.Redis.RedisNativeClient.ParseSingleLine(String r)
at ServiceStack.Redis.RedisNativeClient.SendReceive[T](Byte[][] cmdWithBinaryArgs, Func`1 fn, Action`1 completePipelineFn, Boolean sendWithoutRead)
at ServiceStack.Redis.RedisNativeClient.SendExpectData(Byte[][] cmdWithBinaryArgs)
at ServiceStack.Redis.RedisClient.<>c__DisplayClass130_0`1.<Get>b__0(RedisClient r)
at ServiceStack.Redis.RedisClient.Exec[T](Func`2 action)
at ServiceStack.Redis.RedisClientManagerCacheClient.Get[T](String key)
at ServiceStack.CacheResponseExtensions.<HandleValidCache>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ServiceStack.CacheResponseAttribute.<ExecuteAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__13.MoveNext()
Both services uses the same redis for caching
The redis connection:
string[] redisSentinelHosts = AppSettings.RedisSentinelHosts();
string masterName = AppSettings.RedisSentinelMasterName();
var sentinel = new RedisSentinel(redisSentinelHosts, masterName);
sentinel.HostFilter = (host) => $$"{host}?db={database}";
// Auto-Register Redis
container.Register<IRedisClientsManager>(c => sentinel.Start());
I have no specific configuration for cache
container.RegisterAs<MemoryCacheClient, ICacheClient>("memory");