Skip to content

Commit

Permalink
Fix invariant violation.
Browse files Browse the repository at this point in the history
The comments for msgReleaser suggest we can't hold the lock while doing
this, so add it to the releaseList instead. I'd like to make this harder
to mess up in the future.
  • Loading branch information
zenhack committed Apr 1, 2023
1 parent 777d0b5 commit 9161f0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpc/answer.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (ans *ansent) prepareSendReturn(c *lockedConn, rl *releaseList) {
select {
case <-c.bgctx.Done():
// We're not going to send the message after all, so don't forget to release it.
ans.returner.msgReleaser.Decr()
rl.Add(ans.returner.msgReleaser.Decr)
ans.sendMsg = nil
default:
}
Expand Down

0 comments on commit 9161f0e

Please sign in to comment.