This is the biggest nats.go release in a long time: 47 changes with more than half of them coming from 18 external contributors - thank you all!
Most of this release is a robustness effort. Nearly 30 bug fixes address deadlocks, goroutine and timer leaks, data races and stalls in reconnect and drain handling, pull and ordered consumers, async publish and service API. It also adds the FetchMaxBytes() option and Conn.RemoteAccount().
ADDED
Core NATS:
Conn.RemoteAccount() and ServerInfo.RemoteAccount exposing the account the client is bound to (#2156)
JetStream:
FetchMaxBytes() option to limit both the number of messages and total bytes in a single Fetch() request. Thanks @manenim for the contribution (#2198)
StreamInfo.Domain, StreamInfo.Alternates, StreamState.Lost, StreamSourceInfo.External and StreamSourceInfo.Error in stream info (#2168)
ErrStreamMessageExceedsMaximum for JetStream error code 10054, returned when a message exceeds the stream's MaxMsgSize. Thanks @matehsan for the contribution (#2110)
FIXED
Core NATS:
ForceReconnect() called while already reconnecting disabling ReconnectWait and custom reconnect delays, so the client dialed in a tight loop. Thanks @Arsen302 for the contribution and @MokiMeow for the diagnosis and test (#2179)
Connection closing for good instead of reconnecting after a partial write left a truncated message on the wire (#2169)
Connection status listeners losing an unread event and being unregistered when the next status was sent (#2193)
Message headers not counted against subscription pending byte limits, so header-heavy subscriptions could exceed the limit without reporting a slow consumer. Thanks @Grivn for the contribution (#2200)
Requests interrupted by a reconnect returning ErrConnectionClosed instead of ErrDisconnected. Thanks @AshSgDe29071999 for the contribution (#2129)
Default port added to the path instead of the host for server URLs with a path and no port, e.g. ws://host/nats. Thanks @dannyshafer for the contribution (#2177)
Close() during Drain() flipping the closed connection back to DRAINING_PUBS and flushing on it. Thanks @Kshot3000 for the contribution (#2163)
Drain() waiting for the full DrainTimeout when the connection was closed mid-drain (#2171)
IsSystemAccount() reset to false by async INFO updates, such as cluster topology changes or lame duck mode (#2156)
JetStream:
Pull consumer Consume() and Messages() deadlocking on Stop() or Drain() while buffered messages were still being delivered. Thanks @clwluvw for the contribution (#2165)
Messages() iterator goroutines leaking after the connection is closed. Thanks @clwluvw for the contribution (#2166)
Heartbeat timer and status listener left running when Consume() ends because the connection was closed. Thanks @clwluvw for the contribution (#2164)
Messages() iterator returning ErrMsgIteratorClosed instead of the remaining buffered messages when Next() raced with Drain() (#2188)
Pull consumer with StopAfter stalling until the missed heartbeat check (30s by default) after a pull expired. Thanks @huynguyen7 for the contribution (#2208)
Ordered consumer with StopAfter hanging on Stop()/Drain(), delivering too many or too few messages, or panicking after a consumer reset. Thanks @clwluvw for the contribution (#2167)
Ordered consumer Fetch(), Next() and FetchBytes() blocking forever after returning ErrOrderedConsumerConcurrentRequests, and FetchNoWait() restarting from the beginning of the stream (#2211)
Ordered consumer Consume() and Messages() using the 15s pull consumer heartbeat instead of the 5s ordered default, so a stalled consumer was reset after ~30s instead of ~10s. Thanks @arminazimi for the contribution (#2182)
PublishAsync() exceeding WithPublishAsyncMaxPending() under concurrent calls. Thanks @ShravanthReddy for the contribution (#2126)
Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks @H-XX-D for the contribution (#2150)
Data race between Info() and CachedInfo() on streams and consumers. Thanks @vulragrag-star for the contribution (#2152)
Reusing the same KeyValueConfig.Sources for several KeyValue buckets carrying the first bucket's subject transform into the next ones, so their reads returned ErrKeyNotFound. Thanks @zhechen-cs for the contribution (#2190)
Object Store GetFile() leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @zhechen-cs for the contribution (#2197)
Legacy JetStream:
Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks @H-XX-D for the contribution (#2150)
KeyValue Create() and Update() on a cross-domain mirrored bucket failing with nats: no response from stream. Thanks @spicysharkco for the contribution (#2203)
Object Store GetFile() leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @zhechen-cs for the contribution (#2197)
Service API:
Panic in AddService() on a closed connection (#2154)
Panic with send on closed channel when callbacks were queued during Stop() (#2173)
Service stopping on async errors from unrelated subscriptions with overlapping subjects. Async errors are now matched by subscription, recorded in endpoint stats and passed to ErrorHandler, and only a closed connection stops the service (#2174)
Stopping one service detaching the other services on the same connection from async errors and connection close (#2178)
Service and endpoint metadata changing after it was set, when the application modified the maps passed to or returned by the service (#2194)
Reset() clearing the endpoint queue group reported in stats (#2195)
IMPROVED
Core NATS:
Report Maximum Control Line Exceeded to the async error handler before closing the connection. Thanks @kave08 for the contribution (#2184)
Avoid extra allocations in DecodeHeadersMsg. Thanks @0xAozora for the contribution (#2132)
Compute header size in Msg.Size() without serializing headers. Thanks @0xAozora for the contribution (#2125)
Document that Subscription is safe for concurrent use and that Msg is not reused after delivery. Thanks @kave08 for the contributions (#2183, #2204)
JetStream:
Avoid heap allocation of publish options when publishing without options. Thanks @0xAozora for the contribution (#2124)
Avoid per-message metadata allocations in Fetch(), ordered consumers and Object Store Watch() (#2212)
Legacy JetStream:
Avoid per-message metadata allocations in Object Store Watch() (#2212)
Document the default MaxAckPending for subscriptions that create their own consumer (#2213)
Tests handle v2 ack subjects, which nats-server main now sends by default (#2192, #2186)
Fix ordered consumer test exceeding 1000 consumers (#2155) and bump the tester to fix intermittent server config parse errors (#2170)
Complete Changes
Configuration
📅Schedule: (UTC)
Branch creation
At any time (no schedule defined)
Automerge
At any time (no schedule defined)
🚦Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
If you want to rebase/retry this PR, check this box
This PR contains the following updates:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) | `v1.54.0` → `v1.55.0` |  |  |
| [golang.org/x/mod](https://pkg.go.dev/golang.org/x/mod) | [`v0.41.0` → `v0.42.0`](https://cs.opensource.google/go/x/mod/+/refs/tags/v0.41.0...refs/tags/v0.42.0) |  |  |
---
### Release Notes
<details>
<summary>nats-io/nats.go (github.com/nats-io/nats.go)</summary>
### [`v1.55.0`](https://github.com/nats-io/nats.go/releases/tag/v1.55.0)
[Compare Source](https://github.com/nats-io/nats.go/compare/v1.54.0...v1.55.0)
#### Changelog
This is the biggest nats.go release in a long time: 47 changes with more than half of them coming from 18 external contributors - thank you all!
Most of this release is a robustness effort. Nearly 30 bug fixes address deadlocks, goroutine and timer leaks, data races and stalls in reconnect and drain handling, pull and ordered consumers, async publish and service API. It also adds the `FetchMaxBytes()` option and `Conn.RemoteAccount()`.
##### ADDED
- Core NATS:
- `Conn.RemoteAccount()` and `ServerInfo.RemoteAccount` exposing the account the client is bound to ([#​2156](https://github.com/nats-io/nats.go/issues/2156))
- JetStream:
- `FetchMaxBytes()` option to limit both the number of messages and total bytes in a single `Fetch()` request. Thanks [@​manenim](https://github.com/manenim) for the contribution ([#​2198](https://github.com/nats-io/nats.go/issues/2198))
- `StreamInfo.Domain`, `StreamInfo.Alternates`, `StreamState.Lost`, `StreamSourceInfo.External` and `StreamSourceInfo.Error` in stream info ([#​2168](https://github.com/nats-io/nats.go/issues/2168))
- `ErrStreamMessageExceedsMaximum` for JetStream error code 10054, returned when a message exceeds the stream's `MaxMsgSize`. Thanks [@​matehsan](https://github.com/matehsan) for the contribution ([#​2110](https://github.com/nats-io/nats.go/issues/2110))
##### FIXED
- Core NATS:
- `ForceReconnect()` called while already reconnecting disabling `ReconnectWait` and custom reconnect delays, so the client dialed in a tight loop. Thanks [@​Arsen302](https://github.com/Arsen302) for the contribution and [@​MokiMeow](https://github.com/MokiMeow) for the diagnosis and test ([#​2179](https://github.com/nats-io/nats.go/issues/2179))
- Connection closing for good instead of reconnecting after a partial write left a truncated message on the wire ([#​2169](https://github.com/nats-io/nats.go/issues/2169))
- Connection status listeners losing an unread event and being unregistered when the next status was sent ([#​2193](https://github.com/nats-io/nats.go/issues/2193))
- Message headers not counted against subscription pending byte limits, so header-heavy subscriptions could exceed the limit without reporting a slow consumer. Thanks [@​Grivn](https://github.com/Grivn) for the contribution ([#​2200](https://github.com/nats-io/nats.go/issues/2200))
- Requests interrupted by a reconnect returning `ErrConnectionClosed` instead of `ErrDisconnected`. Thanks [@​AshSgDe29071999](https://github.com/AshSgDe29071999) for the contribution ([#​2129](https://github.com/nats-io/nats.go/issues/2129))
- Default port added to the path instead of the host for server URLs with a path and no port, e.g. `ws://host/nats`. Thanks [@​dannyshafer](https://github.com/dannyshafer) for the contribution ([#​2177](https://github.com/nats-io/nats.go/issues/2177))
- `Close()` during `Drain()` flipping the closed connection back to `DRAINING_PUBS` and flushing on it. Thanks [@​Kshot3000](https://github.com/Kshot3000) for the contribution ([#​2163](https://github.com/nats-io/nats.go/issues/2163))
- `Drain()` waiting for the full `DrainTimeout` when the connection was closed mid-drain ([#​2171](https://github.com/nats-io/nats.go/issues/2171))
- `IsSystemAccount()` reset to false by async INFO updates, such as cluster topology changes or lame duck mode ([#​2156](https://github.com/nats-io/nats.go/issues/2156))
- JetStream:
- Pull consumer `Consume()` and `Messages()` deadlocking on `Stop()` or `Drain()` while buffered messages were still being delivered. Thanks [@​clwluvw](https://github.com/clwluvw) for the contribution ([#​2165](https://github.com/nats-io/nats.go/issues/2165))
- `Messages()` iterator goroutines leaking after the connection is closed. Thanks [@​clwluvw](https://github.com/clwluvw) for the contribution ([#​2166](https://github.com/nats-io/nats.go/issues/2166))
- Heartbeat timer and status listener left running when `Consume()` ends because the connection was closed. Thanks [@​clwluvw](https://github.com/clwluvw) for the contribution ([#​2164](https://github.com/nats-io/nats.go/issues/2164))
- `Messages()` iterator returning `ErrMsgIteratorClosed` instead of the remaining buffered messages when `Next()` raced with `Drain()` ([#​2188](https://github.com/nats-io/nats.go/issues/2188))
- Pull consumer with `StopAfter` stalling until the missed heartbeat check (30s by default) after a pull expired. Thanks [@​huynguyen7](https://github.com/huynguyen7) for the contribution ([#​2208](https://github.com/nats-io/nats.go/issues/2208))
- Ordered consumer with `StopAfter` hanging on `Stop()`/`Drain()`, delivering too many or too few messages, or panicking after a consumer reset. Thanks [@​clwluvw](https://github.com/clwluvw) for the contribution ([#​2167](https://github.com/nats-io/nats.go/issues/2167))
- Ordered consumer `Fetch()`, `Next()` and `FetchBytes()` blocking forever after returning `ErrOrderedConsumerConcurrentRequests`, and `FetchNoWait()` restarting from the beginning of the stream ([#​2211](https://github.com/nats-io/nats.go/issues/2211))
- Ordered consumer `Consume()` and `Messages()` using the 15s pull consumer heartbeat instead of the 5s ordered default, so a stalled consumer was reset after \~30s instead of \~10s. Thanks [@​arminazimi](https://github.com/arminazimi) for the contribution ([#​2182](https://github.com/nats-io/nats.go/issues/2182))
- `PublishAsync()` exceeding `WithPublishAsyncMaxPending()` under concurrent calls. Thanks [@​ShravanthReddy](https://github.com/ShravanthReddy) for the contribution ([#​2126](https://github.com/nats-io/nats.go/issues/2126))
- Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks [@​H-XX-D](https://github.com/H-XX-D) for the contribution ([#​2150](https://github.com/nats-io/nats.go/issues/2150))
- Data race between `Info()` and `CachedInfo()` on streams and consumers. Thanks [@​vulragrag-star](https://github.com/vulragrag-star) for the contribution ([#​2152](https://github.com/nats-io/nats.go/issues/2152))
- Reusing the same `KeyValueConfig.Sources` for several KeyValue buckets carrying the first bucket's subject transform into the next ones, so their reads returned `ErrKeyNotFound`. Thanks [@​zhechen-cs](https://github.com/zhechen-cs) for the contribution ([#​2190](https://github.com/nats-io/nats.go/issues/2190))
- Object Store `GetFile()` leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks [@​zhechen-cs](https://github.com/zhechen-cs) for the contribution ([#​2197](https://github.com/nats-io/nats.go/issues/2197))
- Legacy JetStream:
- Async publish error callbacks for messages pending during a reconnect delayed until the publisher shut down. Thanks [@​H-XX-D](https://github.com/H-XX-D) for the contribution ([#​2150](https://github.com/nats-io/nats.go/issues/2150))
- KeyValue `Create()` and `Update()` on a cross-domain mirrored bucket failing with `nats: no response from stream`. Thanks [@​spicysharkco](https://github.com/spicysharkco) for the contribution ([#​2203](https://github.com/nats-io/nats.go/issues/2203))
- Object Store `GetFile()` leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks [@​zhechen-cs](https://github.com/zhechen-cs) for the contribution ([#​2197](https://github.com/nats-io/nats.go/issues/2197))
- Service API:
- Panic in `AddService()` on a closed connection ([#​2154](https://github.com/nats-io/nats.go/issues/2154))
- Panic with `send on closed channel` when callbacks were queued during `Stop()` ([#​2173](https://github.com/nats-io/nats.go/issues/2173))
- Service stopping on async errors from unrelated subscriptions with overlapping subjects. Async errors are now matched by subscription, recorded in endpoint stats and passed to `ErrorHandler`, and only a closed connection stops the service ([#​2174](https://github.com/nats-io/nats.go/issues/2174))
- Stopping one service detaching the other services on the same connection from async errors and connection close ([#​2178](https://github.com/nats-io/nats.go/issues/2178))
- Service and endpoint metadata changing after it was set, when the application modified the maps passed to or returned by the service ([#​2194](https://github.com/nats-io/nats.go/issues/2194))
- `Reset()` clearing the endpoint queue group reported in stats ([#​2195](https://github.com/nats-io/nats.go/issues/2195))
##### IMPROVED
- Core NATS:
- Report `Maximum Control Line Exceeded` to the async error handler before closing the connection. Thanks [@​kave08](https://github.com/kave08) for the contribution ([#​2184](https://github.com/nats-io/nats.go/issues/2184))
- Avoid extra allocations in `DecodeHeadersMsg`. Thanks [@​0xAozora](https://github.com/0xAozora) for the contribution ([#​2132](https://github.com/nats-io/nats.go/issues/2132))
- Compute header size in `Msg.Size()` without serializing headers. Thanks [@​0xAozora](https://github.com/0xAozora) for the contribution ([#​2125](https://github.com/nats-io/nats.go/issues/2125))
- Document that `Subscription` is safe for concurrent use and that `Msg` is not reused after delivery. Thanks [@​kave08](https://github.com/kave08) for the contributions ([#​2183](https://github.com/nats-io/nats.go/issues/2183), [#​2204](https://github.com/nats-io/nats.go/issues/2204))
- JetStream:
- Avoid heap allocation of publish options when publishing without options. Thanks [@​0xAozora](https://github.com/0xAozora) for the contribution ([#​2124](https://github.com/nats-io/nats.go/issues/2124))
- Avoid per-message metadata allocations in `Fetch()`, ordered consumers and Object Store `Watch()` ([#​2212](https://github.com/nats-io/nats.go/issues/2212))
- Legacy JetStream:
- Avoid per-message metadata allocations in Object Store `Watch()` ([#​2212](https://github.com/nats-io/nats.go/issues/2212))
- Document the default `MaxAckPending` for subscriptions that create their own consumer ([#​2213](https://github.com/nats-io/nats.go/issues/2213))
- Tests handle v2 ack subjects, which nats-server main now sends by default ([#​2192](https://github.com/nats-io/nats.go/issues/2192), [#​2186](https://github.com/nats-io/nats.go/issues/2186))
- Fix ordered consumer test exceeding 1000 consumers ([#​2155](https://github.com/nats-io/nats.go/issues/2155)) and bump the tester to fix intermittent server config parse errors ([#​2170](https://github.com/nats-io/nats.go/issues/2170))
##### Complete Changes
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjQuNyIsInVwZGF0ZWRJblZlciI6IjQ0LjE4MS4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
meda
changed title from Update module golang.org/x/mod to v0.42.0 (master) to Update all deps (master)2026-10-24 13:38:09 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
v1.54.0→v1.55.0v0.41.0→v0.42.0Release Notes
nats-io/nats.go (github.com/nats-io/nats.go)
v1.55.0Compare Source
Changelog
This is the biggest nats.go release in a long time: 47 changes with more than half of them coming from 18 external contributors - thank you all!
Most of this release is a robustness effort. Nearly 30 bug fixes address deadlocks, goroutine and timer leaks, data races and stalls in reconnect and drain handling, pull and ordered consumers, async publish and service API. It also adds the
FetchMaxBytes()option andConn.RemoteAccount().ADDED
Conn.RemoteAccount()andServerInfo.RemoteAccountexposing the account the client is bound to (#2156)FetchMaxBytes()option to limit both the number of messages and total bytes in a singleFetch()request. Thanks @manenim for the contribution (#2198)StreamInfo.Domain,StreamInfo.Alternates,StreamState.Lost,StreamSourceInfo.ExternalandStreamSourceInfo.Errorin stream info (#2168)ErrStreamMessageExceedsMaximumfor JetStream error code 10054, returned when a message exceeds the stream'sMaxMsgSize. Thanks @matehsan for the contribution (#2110)FIXED
ForceReconnect()called while already reconnecting disablingReconnectWaitand custom reconnect delays, so the client dialed in a tight loop. Thanks @Arsen302 for the contribution and @MokiMeow for the diagnosis and test (#2179)ErrConnectionClosedinstead ofErrDisconnected. Thanks @AshSgDe29071999 for the contribution (#2129)ws://host/nats. Thanks @dannyshafer for the contribution (#2177)Close()duringDrain()flipping the closed connection back toDRAINING_PUBSand flushing on it. Thanks @Kshot3000 for the contribution (#2163)Drain()waiting for the fullDrainTimeoutwhen the connection was closed mid-drain (#2171)IsSystemAccount()reset to false by async INFO updates, such as cluster topology changes or lame duck mode (#2156)Consume()andMessages()deadlocking onStop()orDrain()while buffered messages were still being delivered. Thanks @clwluvw for the contribution (#2165)Messages()iterator goroutines leaking after the connection is closed. Thanks @clwluvw for the contribution (#2166)Consume()ends because the connection was closed. Thanks @clwluvw for the contribution (#2164)Messages()iterator returningErrMsgIteratorClosedinstead of the remaining buffered messages whenNext()raced withDrain()(#2188)StopAfterstalling until the missed heartbeat check (30s by default) after a pull expired. Thanks @huynguyen7 for the contribution (#2208)StopAfterhanging onStop()/Drain(), delivering too many or too few messages, or panicking after a consumer reset. Thanks @clwluvw for the contribution (#2167)Fetch(),Next()andFetchBytes()blocking forever after returningErrOrderedConsumerConcurrentRequests, andFetchNoWait()restarting from the beginning of the stream (#2211)Consume()andMessages()using the 15s pull consumer heartbeat instead of the 5s ordered default, so a stalled consumer was reset after ~30s instead of ~10s. Thanks @arminazimi for the contribution (#2182)PublishAsync()exceedingWithPublishAsyncMaxPending()under concurrent calls. Thanks @ShravanthReddy for the contribution (#2126)Info()andCachedInfo()on streams and consumers. Thanks @vulragrag-star for the contribution (#2152)KeyValueConfig.Sourcesfor several KeyValue buckets carrying the first bucket's subject transform into the next ones, so their reads returnedErrKeyNotFound. Thanks @zhechen-cs for the contribution (#2190)GetFile()leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @zhechen-cs for the contribution (#2197)Create()andUpdate()on a cross-domain mirrored bucket failing withnats: no response from stream. Thanks @spicysharkco for the contribution (#2203)GetFile()leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @zhechen-cs for the contribution (#2197)AddService()on a closed connection (#2154)send on closed channelwhen callbacks were queued duringStop()(#2173)ErrorHandler, and only a closed connection stops the service (#2174)Reset()clearing the endpoint queue group reported in stats (#2195)IMPROVED
Maximum Control Line Exceededto the async error handler before closing the connection. Thanks @kave08 for the contribution (#2184)DecodeHeadersMsg. Thanks @0xAozora for the contribution (#2132)Msg.Size()without serializing headers. Thanks @0xAozora for the contribution (#2125)Subscriptionis safe for concurrent use and thatMsgis not reused after delivery. Thanks @kave08 for the contributions (#2183, #2204)Fetch(), ordered consumers and Object StoreWatch()(#2212)Watch()(#2212)MaxAckPendingfor subscriptions that create their own consumer (#2213)Complete Changes
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate CLI.
Update module golang.org/x/mod to v0.42.0 (master)to Update all deps (master)a4eddc9871to33b40c2ce3View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.