Move server running state to atomic to avoid contention at NRG layer.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-09-25 11:18:15 -07:00
parent e594da52e4
commit 7ce47fd182
8 changed files with 16 additions and 21 deletions

View File

@@ -1222,9 +1222,7 @@ func TestServerValidateGatewaysOptions(t *testing.T) {
func TestAcceptError(t *testing.T) {
o := DefaultOptions()
s := New(o)
s.mu.Lock()
s.running = true
s.mu.Unlock()
s.running.Store(true)
defer s.Shutdown()
orgDelay := time.Hour
delay := s.acceptError("Test", fmt.Errorf("any error"), orgDelay)