diff --git a/server/accounts.go b/server/accounts.go index 5e6963ed..7b1826e0 100644 --- a/server/accounts.go +++ b/server/accounts.go @@ -3053,9 +3053,8 @@ func (dr *DirAccResolver) Fetch(name string) (string, error) { dr.Unlock() if srv == nil { return "", err - } else { - return srv.fetch(dr, name) // lookup from other server } + return srv.fetch(dr, name) // lookup from other server } } diff --git a/server/jwt_test.go b/server/jwt_test.go index 259ee0a1..8b4a8f6f 100644 --- a/server/jwt_test.go +++ b/server/jwt_test.go @@ -3531,6 +3531,19 @@ func TestAccountNATSResolverFetch(t *testing.T) { // It is not expected to be hit. When hit the administrator is supposed to take action. passCnt = updateJwt(t, sA.ClientURL(), sysCreds, dpub, djwt1, 3) require_True(t, passCnt == 1) // Only Server C updated + for _, srv := range []*Server{sA, sB, sC} { + if a, ok := srv.accounts.Load(syspub); ok { + acc := a.(*Account) + checkFor(t, time.Second, 20*time.Millisecond, func() error { + acc.mu.Lock() + defer acc.mu.Unlock() + if acc.ctmr != nil { + return fmt.Errorf("Timer still exists") + } + return nil + }) + } + } } func TestAccountNATSResolverCrossClusterFetch(t *testing.T) {