You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
106574: kvserver: avoid leaked replica mutex during delegated snapshot r=erikgrinaker a=tbg
Prompted by cockroachdb#106568, I went
through all callers to `repl.mu.Lock` and `repl.mu.RLock` trying to find places
where we're leaking the mutex on certain return paths.
I found some, including one that at least seems to possibly explain what we saw in cockroachdb#106568.
I also looked into the possibility of panics under a held lock being recovered from
at higher levels in the stack, in particular this code:
https://github.com/cockroachdb/cockroach/blob/81569be4aeb61620d2fd51c41b416f7d0986698e/pkg/sql/colexecerror/error.go#L27-L30
However, it seems sufficiently restricted to recovering only from errors it knows to
be safe to recover from, and in particular it doesn't look like it will ever recover from
any panic in kvserver. I will say that this looks a little brittle, though I don't see a much
better way of doing what this code is trying to achieve.
Release note: None
Epic: None
Co-authored-by: Tobias Grieger <[email protected]>
0 commit comments