Skip to content

Commit

Permalink
fix race
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Collison <derek@nats.io>
  • Loading branch information
derekcollison committed Nov 27, 2018
1 parent 24627b0 commit 7c5d697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2050,10 +2050,11 @@ func (c *client) checkForImportServices(acc *Account, msg []byte) {
}
acc.mu.RLock()
rm := acc.imports.services[string(c.pa.subject)]
invalid := rm != nil && rm.invalid
acc.mu.RUnlock()
// Get the results from the other account for the mapped "to" subject.
// If we have been marked invalid simply return here.
if rm != nil && !rm.invalid && rm.acc != nil && rm.acc.sl != nil {
if rm != nil && !invalid && rm.acc != nil && rm.acc.sl != nil {
var nrr []byte
if rm.ae {
acc.removeServiceImport(rm.from)
Expand Down

0 comments on commit 7c5d697

Please sign in to comment.