Use an account protected method to check for service imports for Gateways. (#4274)

This avoids a potential data race when reloading accounts.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-06-27 20:37:26 -07:00
committed by GitHub

View File

@@ -2953,7 +2953,7 @@ func (c *client) processInboundGatewayMsg(msg []byte) {
// Check if this is a service reply subject (_R_)
noInterest := len(r.psubs) == 0
checkNoInterest := true
if acc.imports.services != nil {
if acc.NumServiceImports() > 0 {
if isServiceReply(c.pa.subject) {
checkNoInterest = false
} else {