Fix sysSubscribe races

Made changes to processSub() to accept subscription properties,
including the icb callback so that it is set prior to add the
subscription to the account's sublist, which prevent races.
Fixed some other racy conditions, notably in addServiceImportSub()

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2020-08-03 11:18:02 -06:00
parent 94fee0eb01
commit 22833c8d1a
13 changed files with 166 additions and 78 deletions

View File

@@ -3845,7 +3845,7 @@ func TestConfigReloadLeafNodeWithRemotesNoChanges(t *testing.T) {
s1, o1 := RunServerWithConfig(conf1)
defer s1.Shutdown()
u, err := url.Parse(fmt.Sprintf("nats://localhost:%d", o1.LeafNode.Port))
u, err := url.Parse(fmt.Sprintf("nats://127.0.0.1:%d", o1.LeafNode.Port))
if err != nil {
t.Fatalf("Error creating url: %v", err)
}