The func subjectIsSubsetMatch() is heavy so do without the account lock.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-09-25 13:01:46 -07:00
parent 54d4640e8b
commit 382da48180

View File

@@ -1717,14 +1717,15 @@ func (a *Account) checkForReverseEntries(reply string, checkInterest, recursed b
var _rs [64]string
rs := _rs[:0]
for k := range a.imports.rrMap {
if subjectIsSubsetMatch(k, reply) {
rs = append(rs, k)
}
rs = append(rs, k)
}
a.mu.RUnlock()
// subjectIsSubsetMatch is heavy so make sure we do this without the lock.
for _, r := range rs {
a._checkForReverseEntry(r, nil, checkInterest, recursed)
if subjectIsSubsetMatch(r, reply) {
a._checkForReverseEntry(r, nil, checkInterest, recursed)
}
}
}