From dea68595fd0ee0e32540b1279a8e38913b952f16 Mon Sep 17 00:00:00 2001 From: Byron Ruth Date: Sun, 16 Apr 2023 15:33:13 -0400 Subject: [PATCH 1/6] Update to Go 1.19.8 Signed-off-by: Byron Ruth --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9885567a..e336db26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ - os: linux dist: focal @@ -7,12 +6,12 @@ vm: language: go go: -- 1.19.6 + - 1.19.8 addons: apt: packages: - - rpm + - rpm go_import_path: github.com/nats-io/nats-server jobs: From a6029a090c32cf265b9c33332045ea9435dd94c5 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Sun, 16 Apr 2023 14:25:33 -0700 Subject: [PATCH 2/6] Update pkg dependencies Signed-off-by: Derek Collison --- go.mod | 10 +++++----- go.sum | 26 ++++++++++---------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 69c9fe86..bcd9096b 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,15 @@ module github.com/nats-io/nats-server/v2 go 1.19 require ( - github.com/klauspost/compress v1.16.0 + github.com/klauspost/compress v1.16.4 github.com/minio/highwayhash v1.0.2 - github.com/nats-io/jwt/v2 v2.3.0 + github.com/nats-io/jwt/v2 v2.4.1 github.com/nats-io/nats.go v1.24.0 - github.com/nats-io/nkeys v0.3.0 + github.com/nats-io/nkeys v0.4.4 github.com/nats-io/nuid v1.0.1 go.uber.org/automaxprocs v1.5.1 - golang.org/x/crypto v0.6.0 - golang.org/x/sys v0.5.0 + golang.org/x/crypto v0.8.0 + golang.org/x/sys v0.7.0 golang.org/x/time v0.3.0 ) diff --git a/go.sum b/go.sum index eab88f4e..1c27cc54 100644 --- a/go.sum +++ b/go.sum @@ -9,16 +9,16 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw 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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= -github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= +github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= +github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= +github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= -github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= +github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= +github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -26,19 +26,13 @@ github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4 github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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= From dea7fc04f30ee53f6ebcf461ff77a3bde29f307c Mon Sep 17 00:00:00 2001 From: Waldemar Quevedo Date: Mon, 17 Apr 2023 00:07:01 -0700 Subject: [PATCH 3/6] Fix nsc in nightly --- docker/Dockerfile.nightly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.nightly b/docker/Dockerfile.nightly index 13fa7d54..87f6d950 100644 --- a/docker/Dockerfile.nightly +++ b/docker/Dockerfile.nightly @@ -9,7 +9,7 @@ RUN mkdir -p src/github.com/nats-io && \ cd natscli/nats && \ go build -ldflags "-w -X main.version=${VERSION}" -o /nats -RUN go install github.com/nats-io/nsc@latest +RUN go install github.com/nats-io/nsc/v2@latest FROM alpine:latest From a9aa280d067b999c2b12bf7f89231d482dad8214 Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Mon, 17 Apr 2023 13:38:06 +0100 Subject: [PATCH 4/6] Bump version to 2.9.16-RC.9 Signed-off-by: Neil Twigg --- server/const.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/const.go b/server/const.go index a2dfba8e..6efb9f19 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.9.16-RC.8" + VERSION = "2.9.16-RC.9" // PROTO is the currently supported protocol. // 0 was the original From 9a3e0b783c550fd751f93dd17b9a70423007413e Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Mon, 17 Apr 2023 06:40:09 -0700 Subject: [PATCH 5/6] Fix for a data race when setting up service import subscriptions. Signed-off-by: Derek Collison --- server/accounts.go | 7 +++++++ server/server.go | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/server/accounts.go b/server/accounts.go index e95fd7bd..fa224662 100644 --- a/server/accounts.go +++ b/server/accounts.go @@ -2017,7 +2017,14 @@ func (a *Account) removeAllServiceImportSubs() { // Add in subscriptions for all registered service imports. func (a *Account) addAllServiceImportSubs() { + var sis [32]*serviceImport + serviceImports := sis[:0] + a.mu.RLock() for _, si := range a.imports.services { + serviceImports = append(serviceImports, si) + } + a.mu.RUnlock() + for _, si := range serviceImports { a.addServiceImportSub(si) } } diff --git a/server/server.go b/server/server.go index 2e62a68e..6ffd0247 100644 --- a/server/server.go +++ b/server/server.go @@ -1594,13 +1594,23 @@ func (s *Server) fetchAccount(name string) (*Account, error) { } // The sub imports may have been setup but will not have had their // subscriptions properly setup. Do that here. + var needImportSubs bool + + acc.mu.Lock() if len(acc.imports.services) > 0 { if acc.ic == nil { acc.ic = s.createInternalAccountClient() acc.ic.acc = acc } + needImportSubs = true + } + acc.mu.Unlock() + + // Do these outside the lock. + if needImportSubs { acc.addAllServiceImportSubs() } + return acc, nil } From 202d49d0698349ebe6c2880a747e35d4cb13034a Mon Sep 17 00:00:00 2001 From: Byron Ruth Date: Mon, 17 Apr 2023 08:07:11 -0400 Subject: [PATCH 6/6] 2.9.16 release Signed-off-by: Byron Ruth --- README.md | 24 ++++++++++++------------ server/const.go | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 73eb034a..168a11b1 100644 --- a/README.md +++ b/README.md @@ -8,24 +8,24 @@ ## Documentation -* [Official Website](https://nats.io) -* [Official Documentation](https://docs.nats.io) -* [FAQ](https://docs.nats.io/reference/faq) -* Watch [a video overview](https://rethink.synadia.com/episodes/1/) of NATS. -* Watch [this video from SCALE 13x](https://www.youtube.com/watch?v=sm63oAVPqAM) to learn more about its origin story and design philosophy. +- [Official Website](https://nats.io) +- [Official Documentation](https://docs.nats.io) +- [FAQ](https://docs.nats.io/reference/faq) +- Watch [a video overview](https://rethink.synadia.com/episodes/1/) of NATS. +- Watch [this video from SCALE 13x](https://www.youtube.com/watch?v=sm63oAVPqAM) to learn more about its origin story and design philosophy. ## Contact -* [Twitter](https://twitter.com/nats_io): Follow us on Twitter! -* [Google Groups](https://groups.google.com/forum/#!forum/natsio): Where you can ask questions -* [Slack](https://natsio.slack.com): Click [here](https://slack.nats.io) to join. You can ask question to our maintainers and to the rich and active community. +- [Twitter](https://twitter.com/nats_io): Follow us on Twitter! +- [Google Groups](https://groups.google.com/forum/#!forum/natsio): Where you can ask questions +- [Slack](https://natsio.slack.com): Click [here](https://slack.nats.io) to join. You can ask question to our maintainers and to the rich and active community. ## Contributing If you are interested in contributing to NATS, read about our... -* [Contributing guide](https://nats.io/community/#contribute) -* [Report issues or propose Pull Requests](https://github.com/nats-io) +- [Contributing guide](https://nats.io/community/#contribute) +- [Report issues or propose Pull Requests](https://github.com/nats-io) [License-Url]: https://www.apache.org/licenses/LICENSE-2.0 [License-Image]: https://img.shields.io/badge/License-Apache2-blue.svg @@ -37,8 +37,8 @@ If you are interested in contributing to NATS, read about our... [Fossa-Image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnats-io%2Fnats-server.svg?type=shield [Build-Status-Url]: https://travis-ci.com/github/nats-io/nats-server [Build-Status-Image]: https://travis-ci.com/nats-io/nats-server.svg?branch=main -[Release-Url]: https://github.com/nats-io/nats-server/releases/tag/v2.9.15 -[Release-image]: https://img.shields.io/badge/release-v2.9.15-1eb0fc.svg +[Release-Url]: https://github.com/nats-io/nats-server/releases/tag/v2.9.16 +[Release-image]: https://img.shields.io/badge/release-v2.9.16-1eb0fc.svg [Coverage-Url]: https://coveralls.io/r/nats-io/nats-server?branch=main [Coverage-image]: https://coveralls.io/repos/github/nats-io/nats-server/badge.svg?branch=main [ReportCard-Url]: https://goreportcard.com/report/nats-io/nats-server diff --git a/server/const.go b/server/const.go index 6efb9f19..f200c289 100644 --- a/server/const.go +++ b/server/const.go @@ -41,7 +41,7 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "2.9.16-RC.9" + VERSION = "2.9.16" // PROTO is the currently supported protocol. // 0 was the original