mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 02:07:59 -07:00
Merge pull request #2034 from nats-io/memstore_locking
Calling out to the storage update should not hold lock.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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...)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user