mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Move check for out of resources which would want a read lock out of inline processing
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1758,9 +1758,15 @@ func (n *raft) setObserver(isObserver bool, extSt extensionState) {
|
||||
|
||||
// Invoked when being notified that there is something in the entryc's queue
|
||||
func (n *raft) processAppendEntries() {
|
||||
ok := !n.outOfResources()
|
||||
if !ok {
|
||||
n.debug("AppendEntry not processing inbound, no resources")
|
||||
}
|
||||
aes := n.entry.pop()
|
||||
for _, ae := range aes {
|
||||
n.processAppendEntry(ae, ae.sub)
|
||||
if ok {
|
||||
for _, ae := range aes {
|
||||
n.processAppendEntry(ae, ae.sub)
|
||||
}
|
||||
}
|
||||
n.entry.recycle(&aes)
|
||||
}
|
||||
@@ -2697,11 +2703,6 @@ func (n *raft) runAsCandidate() {
|
||||
|
||||
// handleAppendEntry handles an append entry from the wire.
|
||||
func (n *raft) handleAppendEntry(sub *subscription, c *client, _ *Account, subject, reply string, msg []byte) {
|
||||
if n.outOfResources() {
|
||||
n.debug("AppendEntry not processing inbound, no resources")
|
||||
return
|
||||
}
|
||||
|
||||
msg = copyBytes(msg)
|
||||
if ae, err := n.decodeAppendEntry(msg, sub, reply); err == nil {
|
||||
n.entry.push(ae)
|
||||
|
||||
Reference in New Issue
Block a user