diff --git a/server/const.go b/server/const.go index f482eb6f..37ee8285 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.2.1-RC8" + VERSION = "2.2.1-RC9" // PROTO is the currently supported protocol. // 0 was the original diff --git a/server/jetstream_cluster.go b/server/jetstream_cluster.go index cdb0f86b..d7f8545f 100644 --- a/server/jetstream_cluster.go +++ b/server/jetstream_cluster.go @@ -4486,6 +4486,9 @@ func (js *jetStream) clusterInfo(rg *raftGroup) *ClusterInfo { for _, rp := range peers { if rp.ID != id && rg.isMember(rp.ID) { lastSeen := now.Sub(rp.Last) + if lastSeen < 0 { + lastSeen = 1 + } current := rp.Current if current && lastSeen > lostQuorumInterval { current = false diff --git a/server/jwt_test.go b/server/jwt_test.go index 46ab1530..5e1ff24b 100644 --- a/server/jwt_test.go +++ b/server/jwt_test.go @@ -3369,7 +3369,7 @@ func TestAccountNATSResolverFetch(t *testing.T) { } connect := func(url string, credsfile string, acc string, srvs ...*Server) { t.Helper() - nc := natsConnect(t, url, nats.UserCredentials(credsfile)) + nc := natsConnect(t, url, nats.UserCredentials(credsfile), nats.Timeout(5*time.Second)) nc.Close() require_NoLocalOrRemoteConnections(acc, srvs...) } diff --git a/server/memstore.go b/server/memstore.go index 9b7085e0..fef1a3cc 100644 --- a/server/memstore.go +++ b/server/memstore.go @@ -492,8 +492,11 @@ func (ms *memStore) removeMsg(seq uint64, secure bool) bool { } if ms.scb != nil { + // We do not want to hold any locks here. + ms.mu.Unlock() delta := int64(ss) ms.scb(-1, -delta, seq, sm.subj) + ms.mu.Lock() } return ok