Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c7d298
[FIXED] Route: Infinite retry cluster connection with invalid credent…
kozlovic Aug 22, 2025
86f440c
[FIXED] Hold consumer lock when reading o.cfg.PauseUntil
MauriceVanVeen Aug 25, 2025
cfa1f24
Handle consumer replica size config drift
wallyqs Aug 25, 2025
ad3253a
NRG: New entries from leader reset WAL during catchup
MauriceVanVeen Aug 25, 2025
d0ed3af
[FIXED] Reject parallel clustered stream create
MauriceVanVeen Aug 25, 2025
0ac8f8a
[FIXED] Mark monitorWg as done if goroutine not started
MauriceVanVeen Aug 25, 2025
a4853d6
Add assert.Unreachable when losing commits
MauriceVanVeen Aug 26, 2025
fe8fd23
Add regression test for R3F multileader condition
wallyqs Aug 25, 2025
dfdf81c
[FIXED] Consumer MaxDeliver underflow
MauriceVanVeen Aug 26, 2025
a296ced
Add missing error check in JWT test for account creation
aricart Aug 26, 2025
09bc73a
Fix TestNRGSwitchStateClearsQueues
sciascid Aug 28, 2025
d0c4d5d
NRG: Reject lower term as candidate
MauriceVanVeen Sep 1, 2025
50d547f
Fix nil pointer dereference in sendDomainLeaderElectAdvisory
sciascid Sep 1, 2025
28bd88c
Assert leader never receives appendEntry for same term
sciascid Sep 1, 2025
8fd9339
Delayed error responses
MauriceVanVeen Jul 18, 2025
daf774f
[ADDED] Offline assets support
MauriceVanVeen Aug 8, 2025
a8d14bd
[FIXED] Cache and limit pending entries
MauriceVanVeen Aug 29, 2025
454e4cc
[FIXED] LeafNode: Subject propagation with daisy chain and import/export
kozlovic Sep 3, 2025
fac77b4
[FIXED] Infinite wait on shutdown of monitor goroutine
MauriceVanVeen Sep 2, 2025
4d3dab8
[FIXED] LeafNode: Don't forward shadow sub unsubscribe if spoke leafnode
kozlovic Sep 4, 2025
b4b4de2
This improves our resync logic for source and mirrors when leafnodes …
derekcollison Sep 6, 2025
8ed9560
Update dependencies
neilalexander Sep 8, 2025
343e983
Update GHA workflow dependencies
neilalexander Sep 8, 2025
3464f3f
Update to Go 1.24.7
neilalexander Sep 8, 2025
94f4d99
Add TestJetStreamClusterAccountMaxConnectionsReconnect
wallyqs Sep 3, 2025
a0875d4
Fix internal JS clients disconnecting on account updates
wallyqs Sep 4, 2025
5c20268
[FIXED] Empty placement triggers move request
MauriceVanVeen Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/nightly-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:
run: docker login -u "${{ inputs.hub_username }}" -p "${{ inputs.hub_password }}"

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
path: src/github.com/nats-io/nats-server

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable
cache-dependency-path: src/github.com/nats-io/nats-server/go.sum
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/long-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mqtt-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
path: src/github.com/nats-io/nats-server

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable
cache-dependency-path: src/github.com/nats-io/nats-server/go.sum
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-tags: true

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "stable"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v9
- uses: actions/stale@v10
with:
stale-issue-label: stale
stale-pr-label: stale
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"

Expand All @@ -92,7 +92,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -107,7 +107,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"

Expand All @@ -129,7 +129,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: "go.mod"

Expand All @@ -146,7 +146,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -163,7 +163,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -180,7 +180,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -197,7 +197,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -214,7 +214,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -231,7 +231,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -248,7 +248,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -265,7 +265,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -282,7 +282,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -299,7 +299,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -316,7 +316,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -333,7 +333,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -350,7 +350,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -367,7 +367,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -384,7 +384,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand All @@ -401,7 +401,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: stable

Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ builds:
env:
# This is the toolchain version we use for releases. To override, set the env var, e.g.:
# GORELEASER_TOOLCHAIN="go1.22.8" TARGET='linux_amd64' goreleaser build --snapshot --clean --single-target
- GOTOOLCHAIN={{ envOrDefault "GORELEASER_TOOLCHAIN" "go1.24.6" }}
- GOTOOLCHAIN={{ envOrDefault "GORELEASER_TOOLCHAIN" "go1.24.7" }}
- GO111MODULE=on
- CGO_ENABLED=0
goos:
Expand Down
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
module github.com/nats-io/nats-server/v2

go 1.23.0

toolchain go1.23.12
go 1.24.0

require (
github.com/antithesishq/antithesis-sdk-go v0.4.3-default-no-op
github.com/google/go-tpm v0.9.5
github.com/klauspost/compress v1.18.0
github.com/minio/highwayhash v1.0.3
github.com/nats-io/jwt/v2 v2.7.4
github.com/nats-io/nats.go v1.44.0
github.com/nats-io/nats.go v1.45.0
github.com/nats-io/nkeys v0.4.11
github.com/nats-io/nuid v1.0.1
go.uber.org/automaxprocs v1.6.0
golang.org/x/crypto v0.41.0
golang.org/x/sys v0.35.0
golang.org/x/time v0.12.0
golang.org/x/sys v0.36.0
golang.org/x/time v0.13.0
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD
github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ=
github.com/nats-io/jwt/v2 v2.7.4 h1:jXFuDDxs/GQjGDZGhNgH4tXzSUK6WQi2rsj4xmsNOtI=
github.com/nats-io/jwt/v2 v2.7.4/go.mod h1:me11pOkwObtcBNR8AiMrUbtVOUGkqYjMQZ6jnSdVUIA=
github.com/nats-io/nats.go v1.44.0 h1:ECKVrDLdh/kDPV1g0gAQ+2+m2KprqZK5O/eJAyAnH2M=
github.com/nats-io/nats.go v1.44.0/go.mod h1:iRWIPokVIFbVijxuMQq4y9ttaBTMe0SFdlZfMDd+33g=
github.com/nats-io/nats.go v1.45.0 h1:/wGPbnYXDM0pLKFjZTX+2JOw9TQPoIgTFrUaH97giwA=
github.com/nats-io/nats.go v1.45.0/go.mod h1:iRWIPokVIFbVijxuMQq4y9ttaBTMe0SFdlZfMDd+33g=
github.com/nats-io/nkeys v0.4.11 h1:q44qGV008kYd9W1b1nEBkNzvnWxtRSQ7A8BoqRrcfa0=
github.com/nats-io/nkeys v0.4.11/go.mod h1:szDimtgmfOi9n25JpfIdGw12tZFYXqhGxjhVxsatHVE=
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
Expand All @@ -27,9 +27,9 @@ go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwE
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI=
golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
18 changes: 17 additions & 1 deletion server/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,21 @@ func (a *Account) getClients() []*client {
return clients
}

// Returns a slice of external (non-internal) clients stored in the account, or nil if none is present.
// Lock is held on entry.
func (a *Account) getExternalClientsLocked() []*client {
if len(a.clients) == 0 {
return nil
}
var clients []*client
for c := range a.clients {
if !isInternalClient(c.kind) {
clients = append(clients, c)
}
}
return clients
}

// Called to track a remote server and connections and leafnodes it
// has for this account.
func (a *Account) updateRemoteServer(m *AccountNumConns) []*client {
Expand All @@ -398,7 +413,8 @@ func (a *Account) updateRemoteServer(m *AccountNumConns) []*client {
// conservative and bit harsh here. Clients will reconnect if we over compensate.
var clients []*client
if mtce {
clients = a.getClientsLocked()
clients = a.getExternalClientsLocked()

// Sort in reverse chronological.
slices.SortFunc(clients, func(i, j *client) int { return -i.start.Compare(j.start) })
over := (len(a.clients) - int(a.sysclients) + int(a.nrclients)) - int(a.mconns)
Expand Down
11 changes: 8 additions & 3 deletions server/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3563,9 +3563,14 @@ func TestAccountMaxConnectionsDisconnectsNewestFirst(t *testing.T) {
disconnects := make([]chan error, 0)
for i := 1; i <= 3; i++ {
disconnectCh := make(chan error)
c, err := nats.Connect(s.ClientURL(), nats.UserInfo(fmt.Sprintf("user%d", i), "foo"), nats.DisconnectErrHandler(func(_ *nats.Conn, err error) {
disconnectCh <- err
}))
c, err := nats.Connect(
s.ClientURL(),
nats.UserInfo(fmt.Sprintf("user%d", i), "foo"),
nats.DisconnectErrHandler(func(_ *nats.Conn, err error) {
disconnectCh <- err
}),
nats.NoReconnect(),
)
require_NoError(t, err)
defer c.Close()
conns = append(conns, c)
Expand Down
4 changes: 2 additions & 2 deletions server/auth_callout.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func (s *Server) processClientOrLeafCallout(c *client, opts *Options) (authorize
return false, errStr
}
req := []byte(b)
var hdr map[string]string
var hdr []byte

// Check if we have been asked to encrypt.
if xkp != nil {
Expand All @@ -413,7 +413,7 @@ func (s *Server) processClientOrLeafCallout(c *client, opts *Options) (authorize
s.Warnf(errStr)
return false, errStr
}
hdr = map[string]string{AuthRequestXKeyHeader: xkey}
hdr = genHeader(hdr, AuthRequestXKeyHeader, xkey)
}

// Send out our request.
Expand Down
Loading
Loading