StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

Sometimes happnes RedisConnectionException: SocketClosed by accessing AWS ElasticClache

Open mi-yamazaki opened this issue 4 years ago • 6 comments

Hello. I am developing some SignalR core web app on .NET Core 3.1.1. My Application accesses AWS ElasticClache by using StackExchange.Redis (v2.0.593) through Microsoft.AspNetCore.SignalR.StackExchangeRedis (v3.1.1) and sometimes happens RedisConnectionException below (a).

I tried some actions bellow (b), but failed.

Please let me know if you have any good ideas to solve it.

(a)RedisConnectionException Message 2020-06-06 11:02:12.8330|9|ERROR|Microsoft.AspNetCore.SignalR.StackExchangeRedis.RedisHubLifetimeManager|Connection to Redis failed. StackExchange.Redis.RedisConnectionException: SocketClosed (ReadEndOfStream, last-recv: 0) on XXXXXXX.XXXXXX.XX.XXXX.apne1.cache.amazonaws.com:6379/Subscription, Idle/MarkProcessed, last: PING, origin: ReadFromPipe, outstanding: 0, last-read: 0s ago, last-write: 37s ago, keep-alive: 60s, state: ConnectedEstablished, mgr: 9 of 10 available, in: 0, in-pipe: 0, out-pipe: 0, last-heartbeat: 0s ago, last-mbeat: 0s ago, global: 0s ago, v: 2.0.593.37019

(b)My actions

  • updated StackExchange.Redis to 2.1.30.38891
  • chnage redis paramters of connectTimeout, connectRetry, abortConnect
  • change SignalR paramters of StreamBufferCapacity, MaximumReceiveMessageSize

Appreciate any help.

mi-yamazaki avatar Jun 06 '20 07:06 mi-yamazaki

@mi-yamazaki did you find a workaround? did you try with 2.1.55?

gkorland avatar Jun 14 '20 08:06 gkorland

@gkorland Thank you for your reply.

I did not find a workaround, but setting connectRetry to 100 will be seemd to have my issue occur a bit less fluequency, though I don't really understand why.

I did not try 2.1.55 yet, and will try it. Thank you.

mi-yamazaki avatar Jun 15 '20 08:06 mi-yamazaki

@gkorland 2.1.55 cannot solve my issue, to my regret.

mi-yamazaki avatar Jun 15 '20 11:06 mi-yamazaki

@mi-yamazaki have you managed to fix this? We are having the same issue.

marioQueiros-infotrack avatar Jan 28 '22 17:01 marioQueiros-infotrack

Sorry. I have no solution clearly.

michihiro88 avatar Jan 31 '22 22:01 michihiro88

Hi @mi-yamazaki, could you please let me know if you managed to fix this issue, thanks 🙏

prawinxp avatar Jun 22 '22 11:06 prawinxp