StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.85k stars 1.5k forks source link

NRE on ConnectionMultiplexer.WaitAllIgnoreErrors #2754

Open czd890 opened 1 week ago

czd890 commented 1 week ago

Sometimes this error is caught on the server (out of hundreds of instances, 1-2 times every 2-3 days). I looked through the sourcecode and this NRE exception doesn't seem to be possible. 😢

{
    "exception": {
        "Type": "System.NullReferenceException",
        "TargetSite": "Boolean WaitAllIgnoreErrors(System.Threading.Tasks.Task[])",
        "Message": "Object reference not set to an instance of an object.",
        "Data": {},
        "Source": "StackExchange.Redis",
        "HResult": -2147467261,
        "StackTrace": "   
at StackExchange.Redis.ConnectionMultiplexer.WaitAllIgnoreErrors(Task[] tasks) 
in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 463\n   
at StackExchange.Redis.ConnectionMultiplexer.Close(Boolean allowCommandsToComplete) 
in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2301\n   
at StackExchange.Redis.ConnectionMultiplexer.Dispose() 
in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2259\n
in mycode stacks..."
    }
}

version: 2.7.33.41805

NickCraver commented 1 day ago

Do you know if this is happening during shutdown, e.g. possibly a usage while the ConnectionMultiplexer is being disposed?