Open teemka opened 8 months ago
I've tested it against other instances of Redis and it seems that it only happens with AWS.
I'm experiencing this with Azure Cache for Redis:
info: StackExchange.Redis.ConnectionMultiplexer[0]
Sync timeouts: 0; async timeouts: 0; fire and forget: 0; last heartbeat: -1s ago
info: StackExchange.Redis.ConnectionMultiplexer[0]
Starting heartbeat...
info: StackExchange.Redis.ConnectionMultiplexer[0]
Total connect time: 391 ms
info: Program[0]
Connected to Redis
info: Program[0]
Shutting down
fail: StackExchange.Redis.ConnectionMultiplexer[0]
SocketClosed on HOST.redis.cache.windows.net:6380/Subscription, Idle/MarkProcessed, last: QUIT, origin: ReadFromPipe, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablished, mgr: 9 of 10 available, in: 0, last-heartbeat: never, global: 0s ago, v: 2.8.16.12844
StackExchange.Redis.RedisConnectionException: SocketClosed on HOST.redis.cache.windows.net:6380/Subscription, Idle/MarkProcessed, last: QUIT, origin: ReadFromPipe, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablished, mgr: 9 of 10 available, in: 0, last-heartbeat: never, global: 0s ago, v: 2.8.16.12844
it's annoying that they appear
I would like to keep spurious errors out of our logs; I don't want a "fail" to be logged if a graceful shutdown could happen instead.
It looks like SE.Redis tries to suppress error logging here: https://github.com/StackExchange/StackExchange.Redis/blob/00711481f92c06ccd4f83886e3d2b6e70718206b/src/StackExchange.Redis/PhysicalConnection.cs#L442-L443
However, that only works if pipe is SocketConnection
, which will only occur if stream is null
: https://github.com/StackExchange/StackExchange.Redis/blob/00711481f92c06ccd4f83886e3d2b6e70718206b/src/StackExchange.Redis/PhysicalConnection.cs#L1608-L1615
Which won't be true if we're using SSL: https://github.com/StackExchange/StackExchange.Redis/blob/00711481f92c06ccd4f83886e3d2b6e70718206b/src/StackExchange.Redis/PhysicalConnection.cs#L1556-L1566
This may be why @teemka reported that it only happens with AWS (and I'm encountering it with Azure): it's more typical to use SSL with PaaS Redis?
Hi,
I've recently enabled logging in an application and during shutdown we are getting a lot of error logs
RedisConnectionException: SocketClosed
. They appear after ConnectionMultiplexer has been disposed (last command is QUIT). I have reproduced the issue in a simple console Program. I've tested it against other instances of Redis and it seems that it only happens with AWS. Those errors don't propagate to the user code but it's annoying that they appear.Client information: Windows 10, nuget v2.7.20, .NET 8.0.2 Server information: Amazon ElastiCache Redis instance v7.0.7, clustering enabled, 3 shard, 6 nodes
Minimum code to reproduce:
Logs from the execution: