Fixed data race

Resolves #1176

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2019-10-30 20:10:37 -06:00
parent 636ff95627
commit 0da1afaf88

View File

@@ -1257,7 +1257,7 @@ func (s *Server) debugSubscribers(sub *subscription, c *client, subject, reply s
delete(s.sys.replies, replySubj)
s.mu.Unlock()
// Send the response.
s.sendInternalAccountMsg(c.acc, reply, nsubs)
s.sendInternalAccountMsg(c.acc, reply, atomic.LoadInt32(&nsubs))
}()
}