Open derfenix opened 2 years ago
Seems like nil conection returned from the pool, but have no idea how it's possible
It looks like there is a code path that might allow both the err
and the connection to be nil.
If there are more dial errors than the "pool size" then it will return the last dial error.
But if the last dial error is nil for whatever reason, then this function could return nil, nil
causing such a panic.
Looking at this, this seems to be the only way that you could get a nil connection without an error path. But I don't see an immediate way that that error could be nil under those circumstances.
Found a conn.Execute
in onConnect handler in legacy code. May be this thing can lead to the nil conn in case of full pool?
Reproduced only on prod, so trying to reproduce it locally first with no luck yet.
Have no idea how to handle or investigate this panic.