我正在使用控制台应用程序每隔几秒钟向Redis实例推送一些数据。 大致上我是这样做的:
int foo = GetFoo();
BigObject bar = GetBigObject();
_cache.StringSet("Foo", JsonConvert.SerializeObject(foo));
_cache.StringSet("Bar", JsonConvert.SerializeObject(bar));
但是一段时间后我会收到一个异常:
StackExchange.Redis.RedisTimeoutException:'超时执行SET RtSignal-op(5000毫秒),inst:0,qu:0,qs:0,aw:False,rs:CompletePendingMessage,ws:Idle,in:0,in-pipe :5,out-pipe:0,serverEndpoint:Unspecified / localhost:5002,mgr:10个中有9个可用,clientName:SVGD0083,IOCP:(Busy = 0,Free = 1000,Min = 16,Max = 1000),WORKER:(Busy = 3,Free = 32764,Min = 16,Max = 32767),v:2.0.593.37019 (请查看此文章以获取导致超时的一些常见客户端问题:https://stackexchange.github.io/StackExchange.Redis/Timeouts)'
链接页面中提到了可能的问题是由于 Thread Theft
导致的,并提供了以下解决方案:
ConnectionMultiplexer.SetFeatureFlag("preventthreadtheft", true);
问题在于.NET框架中似乎不存在一个名为
SetFeatureFlag
的方法。
有什么想法吗?