Skip to content

Commit

Permalink
Merge pull request #506 from nats-io/fix_delete_channel
Browse files Browse the repository at this point in the history
Fixed deletion of channels
  • Loading branch information
kozlovic committed Mar 9, 2018
2 parents 5ed80b6 + 05b642f commit dbf5548
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 305 deletions.
8 changes: 2 additions & 6 deletions server/clustering.go
Expand Up @@ -461,12 +461,8 @@ func (r *raftFSM) Apply(l *raft.Log) interface{} {
}
return nil
case spb.RaftOperation_DeleteChannel:
// If we are replicating and this node is the leader,
// the function we call must not grab a lock since the
// caller has it. So grab the lock in case of replay
// or if this node is not the leader.
useLocking := !s.isLeader()
return s.processDeleteChannel(op.Channel, useLocking)
s.processDeleteChannel(op.Channel)
return nil
default:
panic(fmt.Sprintf("unknown op type %s", op.OpType))
}
Expand Down

0 comments on commit dbf5548

Please sign in to comment.