mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
Fix for API data race. (#4030)
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1515,6 +1515,7 @@ func TestAccountClaimsUpdatesWithServiceImports(t *testing.T) {
|
||||
nc.Publish(claimUpdateSubj, []byte(ajwt2))
|
||||
}
|
||||
nc.Flush()
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
|
||||
if startSubs < s.NumSubscriptions() {
|
||||
t.Fatalf("Subscriptions leaked: %d vs %d", startSubs, s.NumSubscriptions())
|
||||
|
||||
@@ -890,10 +890,17 @@ func (s *Server) sendAPIErrResponse(ci *ClientInfo, acc *Account, subject, reply
|
||||
const errRespDelay = 500 * time.Millisecond
|
||||
|
||||
func (s *Server) sendDelayedAPIErrResponse(ci *ClientInfo, acc *Account, subject, reply, request, response string, rg *raftGroup) {
|
||||
js := s.getJetStream()
|
||||
if js == nil {
|
||||
return
|
||||
}
|
||||
var quitCh <-chan struct{}
|
||||
js.mu.RLock()
|
||||
if rg != nil && rg.node != nil {
|
||||
quitCh = rg.node.QuitC()
|
||||
}
|
||||
js.mu.RUnlock()
|
||||
|
||||
s.startGoRoutine(func() {
|
||||
defer s.grWG.Done()
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user