Skip to content

Commit

Permalink
kvserver: don't NPE in poisonInflightLatches
Browse files Browse the repository at this point in the history
I still don't understand how we can get a finished endCmds here, but
while I scratch my head we don't need to be collecting CI failures.

Touches cockroachdb#86547.

Epic: none
Release note: None
  • Loading branch information
tbg committed Jan 24, 2023
1 parent dc974cd commit 40617ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/kv/kvserver/replica_raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,9 @@ func (r *Replica) poisonInflightLatches(err error) {
defer r.mu.Unlock()
for _, p := range r.mu.proposals {
p.ec.poison()
if p.ec.g.Req.PoisonPolicy == poison.Policy_Error {
// TODO(tbg): find out how `p.ec.done()` can have been called at this point,
// See: https://github.com/cockroachdb/cockroach/issues/86547
if p.ec.g != nil && p.ec.g.Req.PoisonPolicy == poison.Policy_Error {
aErr := roachpb.NewAmbiguousResultError(err)
// NB: this does not release the request's latches. It's important that
// the latches stay in place, since the command could still apply.
Expand Down

0 comments on commit 40617ed

Please sign in to comment.