From c9f78d6f7937d6c6a647a1ae3b90e611e192a772 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Tue, 19 May 2020 16:38:19 -0700 Subject: [PATCH] Fixes post rebasing with master Signed-off-by: Derek Collison --- go.mod | 1 - go.sum | 22 ---------------------- server/accounts.go | 3 ++- server/client.go | 10 ++++++---- server/server.go | 22 ++++++++++++---------- vendor/modules.txt | 19 +------------------ 6 files changed, 21 insertions(+), 56 deletions(-) diff --git a/go.mod b/go.mod index 51972763..bdb274a0 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.14 require ( github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7 github.com/nats-io/nats.go v1.10.0 - github.com/golang/protobuf v1.3.5 // indirect github.com/minio/highwayhash v1.0.0 github.com/nats-io/nkeys v0.1.4 github.com/nats-io/nuid v1.0.1 diff --git a/go.sum b/go.sum index f045dbec..f2399d79 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,5 @@ -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/minio/highwayhash v1.0.0 h1:iMSDhgUILCr0TNm8LWlSjF8N0ZIj2qbO8WHp6Q/J2BA= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= -github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7 h1:RnGotxlghqR5D2KDAu4TyuLqyjuylOsJiAFhXvMvQIc= github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= @@ -34,12 +21,3 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7 h1:HmbHVPwrPEKPGLAcHSrMe6+hqSUlvZU0rab6x5EXfGU= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= diff --git a/server/accounts.go b/server/accounts.go index 33263d5a..c9437a56 100644 --- a/server/accounts.go +++ b/server/accounts.go @@ -525,6 +525,7 @@ func (a *Account) randomClient() *client { if a.ic != nil { return a.ic } + var c *client for c = range a.clients { break } @@ -943,7 +944,7 @@ func (a *Account) sendTrackingLatency(si *serviceImport, responder *client) bool // properly in any clients doing rrTracking. // Lock should be held. func (a *Account) updateAllClientsServiceExportResponseTime(lrt time.Duration) { - for _, c := range a.clients { + for c := range a.clients { c.mu.Lock() if c.rrTracking != nil && lrt != c.rrTracking.lrt { c.rrTracking.lrt = lrt diff --git a/server/client.go b/server/client.go index e5f11dab..d2e9af97 100644 --- a/server/client.go +++ b/server/client.go @@ -1218,10 +1218,12 @@ func (c *client) markConnAsClosed(reason ClosedState, skipFlush bool) bool { } // Be consistent with the creation: for routes and gateways, // we use Noticef on create, so use that too for delete. - if c.kind == ROUTER || c.kind == GATEWAY { - c.Noticef("%s connection closed: %s", c.typeString(), reason) - } else { // Client and Leaf Node connections. - c.Debugf("%s connection closed: %s", c.typeString(), reason) + if c.srv != nil { + if c.kind == ROUTER || c.kind == GATEWAY { + c.Noticef("%s connection closed: %s", c.typeString(), reason) + } else { // Client and Leaf Node connections. + c.Debugf("%s connection closed: %s", c.typeString(), reason) + } } // Save off the connection if its a client or leafnode. diff --git a/server/server.go b/server/server.go index 8dda922c..f79f4535 100644 --- a/server/server.go +++ b/server/server.go @@ -280,16 +280,17 @@ func NewServer(opts *Options) (*Server, error) { now := time.Now() s := &Server{ - kp: kp, - configFile: opts.ConfigFile, - info: info, - prand: rand.New(rand.NewSource(time.Now().UnixNano())), - opts: opts, - done: make(chan bool, 1), - start: now, - configTime: now, - gwLeafSubs: NewSublistWithCache(), - eventIds: nuid.New(), + kp: kp, + configFile: opts.ConfigFile, + info: info, + prand: rand.New(rand.NewSource(time.Now().UnixNano())), + opts: opts, + done: make(chan bool, 1), + start: now, + configTime: now, + gwLeafSubs: NewSublistWithCache(), + httpBasePath: httpBasePath, + eventIds: nuid.New(), } // Trusted root operator keys. @@ -515,6 +516,7 @@ func (s *Server) configureAccounts() error { for _, si := range acc.imports.services { if v, ok := s.accounts.Load(si.acc.Name); ok { si.acc = v.(*Account) + si.se = si.acc.getServiceExport(si.to) } } // Make sure the subs are running, but only if not reloading. diff --git a/vendor/modules.txt b/vendor/modules.txt index 088ccbaa..bd74d26c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,21 +1,10 @@ -<<<<<<< HEAD -======= -# github.com/golang/protobuf v1.3.5 ->>>>>>> Rebase with master, updates to go.mod and vendor, bumped version -## explicit # github.com/minio/highwayhash v1.0.0 ## explicit github.com/minio/highwayhash -<<<<<<< HEAD # github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7 -github.com/nats-io/jwt -# github.com/nats-io/nats.go v1.10.0 -======= -# github.com/nats-io/jwt v0.3.2 ## explicit github.com/nats-io/jwt -# github.com/nats-io/nats.go v1.9.2 ->>>>>>> Rebase with master, updates to go.mod and vendor, bumped version +# github.com/nats-io/nats.go v1.10.0 ## explicit github.com/nats-io/nats.go github.com/nats-io/nats.go/encoders/builtin @@ -40,9 +29,3 @@ golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc golang.org/x/sys/windows/svc/eventlog golang.org/x/sys/windows/svc/mgr -<<<<<<< HEAD -# google.golang.org/protobuf v1.22.0 -## explicit -golang.org/x/sys/cpu -======= ->>>>>>> Rebase with master, updates to go.mod and vendor, bumped version