StackExchange.Redis操作Redis偶尔会有报错

2020-06-25 20:40发布

问题:

{"Message":"Invalid bulk string terminator","Source":"StackExchange.Redis","StackTrace":" 在 StackExchange.Redis.PhysicalConnection.ReadBulkString(Byte[] buffer, Int32& offset, Int32& count)
在 StackExchange.Redis.PhysicalConnection.TryParseResult(Byte[] buffer, Int32& offset, Int32& count)
在 StackExchange.Redis.PhysicalConnection.ReadArray(Byte[] buffer, Int32& offset, Int32& count)
在 StackExchange.Redis.PhysicalConnection.TryParseResult(Byte[] buffer, Int32& offset, Int32& count)
在 StackExchange.Redis.PhysicalConnection.ProcessBuffer(Byte[] underlying, Int32& offset, Int32& count)
在 StackExchange.Redis.PhysicalConnection.ProcessReadBytes(Int32 bytesRead)
在 StackExchange.Redis.PhysicalConnection.StackExchange.Redis.ISocketCallback.Read()","TargetSite":{"Name":"ReadBulkString","AssemblyName":"StackExchange.Redis, Version=1.1.608.0, Culture=neutral, PublicKeyToken=null","ClassName":"StackExchange.Redis.PhysicalConnection","Signature":"StackExchange.Redis.RawResult ReadBulkString(Byte[], Int32 ByRef, Int32 ByRef)","Signature2":"StackExchange.Redis.RawResult ReadBulkString(System.Byte[], System.Int32&, System.Int32&)","MemberType":8,"GenericArguments":null}}

回答1:

字符串太长了



回答2:

用CSRedisCore试试