mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Don't warn if error is node closed.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -2507,6 +2507,10 @@ func (n *raft) applyCommit(index uint64) error {
|
||||
// Used to track a success response and apply entries.
|
||||
func (n *raft) trackResponse(ar *appendEntryResponse) {
|
||||
n.Lock()
|
||||
if n.state == Closed {
|
||||
n.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
// Update peer's last index.
|
||||
if ps := n.peers[ar.peer]; ps != nil && ar.index > ps.li {
|
||||
@@ -2532,8 +2536,8 @@ func (n *raft) trackResponse(ar *appendEntryResponse) {
|
||||
if nr := len(results); nr >= n.qn {
|
||||
// We have a quorum.
|
||||
for index := n.commit + 1; index <= ar.index; index++ {
|
||||
if err := n.applyCommit(index); err != nil {
|
||||
n.error("Got an error apply commit for %d: %v", index, err)
|
||||
if err := n.applyCommit(index); err != nil && err != errNodeClosed {
|
||||
n.error("Got an error applying commit for %d: %v", index, err)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user