nats-go @ v1.55.0
integrity
- size
- 938.8 KiB
- downloaded
- last checked
- overlays
- go
- detected
- go module github.com/nats-io/nats.go
release notes
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()andServerInfo.RemoteAccountexposing the account the client is bound to (#2156)
- JetStream:
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
- Core NATS:
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)- 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
ErrConnectionClosedinstead ofErrDisconnected. 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()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)
- JetStream:
- Pull consumer
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)- Heartbeat timer and status listener left running when
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)- Pull consumer with
StopAfterstalling until the missed heartbeat check (30s by default) after a pull expired. Thanks @huynguyen7 for the contribution (#2208) - Ordered consumer with
StopAfterhanging onStop()/Drain(), delivering too many or too few messages, or panicking after a consumer reset. Thanks @clwluvw for the contribution (#2167) - Ordered consumer
Fetch(),Next()andFetchBytes()blocking forever after returningErrOrderedConsumerConcurrentRequests, andFetchNoWait()restarting from the beginning of the stream (#2211) - Ordered consumer
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)- 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()andCachedInfo()on streams and consumers. Thanks @vulragrag-star for the contribution (#2152) - Reusing the same
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) - Object Store
GetFile()leaving trailing bytes of an existing destination file when downloading a shorter object. Thanks @zhechen-cs for the contribution (#2197)
- Pull consumer
- 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()andUpdate()on a cross-domain mirrored bucket failing withnats: 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 channelwhen callbacks were queued duringStop()(#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)
- Panic in
IMPROVED
- Core NATS:
- Report
Maximum Control Line Exceededto 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
Subscriptionis safe for concurrent use and thatMsgis not reused after delivery. Thanks @kave08 for the contributions (#2183, #2204)
- Report
- 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 StoreWatch()(#2212)
- Legacy JetStream:
- Avoid per-message metadata allocations in Object Store
Watch()(#2212) - Document the default
MaxAckPendingfor subscriptions that create their own consumer (#2213)
- Avoid per-message metadata allocations in Object Store
- 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
https://github.com/nats-io/nats.go/compare/v1.54.0...v1.55.0
download
unix · zip
curl -fL -o v1.55.0.zip https://ratatoskr.space/pkg/nats-go/v1.55.0.zip
printf '%s %s\n' 'a23dcc54f938866827c74f8fccb4f43c7583459a5afd1e330dc4e32362ba69ea' 'v1.55.0.zip' | sha256sum -c -
windows · zip
$url = "https://ratatoskr.space/pkg/nats-go/v1.55.0.zip"
$out = "v1.55.0.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "a23dcc54f938866827c74f8fccb4f43c7583459a5afd1e330dc4e32362ba69ea") { throw "sha256 mismatch" }
unix · tar.gz
curl -fL -o v1.55.0.tar.gz https://ratatoskr.space/pkg/nats-go/v1.55.0.tar.gz
printf '%s %s\n' '8d0328195910d22a41a43c7533ebfe6f5b1100405e393b16dbf30907d5aa4b5a' 'v1.55.0.tar.gz' | sha256sum -c -
windows · tar.gz
$url = "https://ratatoskr.space/pkg/nats-go/v1.55.0.tar.gz"
$out = "v1.55.0.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "8d0328195910d22a41a43c7533ebfe6f5b1100405e393b16dbf30907d5aa4b5a") { throw "sha256 mismatch" }
download via yggdrasil mesh
unix · zip
curl -fL -o v1.55.0.zip http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go/v1.55.0.zip
printf '%s %s\n' 'a23dcc54f938866827c74f8fccb4f43c7583459a5afd1e330dc4e32362ba69ea' 'v1.55.0.zip' | sha256sum -c -
windows · zip
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go/v1.55.0.zip"
$out = "v1.55.0.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "a23dcc54f938866827c74f8fccb4f43c7583459a5afd1e330dc4e32362ba69ea") { throw "sha256 mismatch" }
unix · tar.gz
curl -fL -o v1.55.0.tar.gz http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go/v1.55.0.tar.gz
printf '%s %s\n' '8d0328195910d22a41a43c7533ebfe6f5b1100405e393b16dbf30907d5aa4b5a' 'v1.55.0.tar.gz' | sha256sum -c -
windows · tar.gz
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go/v1.55.0.tar.gz"
$out = "v1.55.0.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "8d0328195910d22a41a43c7533ebfe6f5b1100405e393b16dbf30907d5aa4b5a") { throw "sha256 mismatch" }
| artifact | format | size | hashes |
|---|---|---|---|
| v1.55.0.zip | zip | 928.4 KiB |
blake3-24 0930e09b0266edc8fce3570e4a6274aafb7cd42e21108745
sha256 a23dcc54f938866827c74f8fccb4f43c7583459a5afd1e330dc4e32362ba69ea
sha1 a6d735f722eb7cc9fd315d8a7c6c6c8c70329aae
|
| v1.55.0.tar.gz | tar.gz | 778.7 KiB |
blake3-24 1158f28352a79750838861a3a68d861a88dfa038c887d2ee
sha256 8d0328195910d22a41a43c7533ebfe6f5b1100405e393b16dbf30907d5aa4b5a
sha1 9b8b3374722ce8574399d0f75d648da32d434a47
|
go module archive
module zip with the module path rewritten to this mirror; fetched by go get through the
GOPROXY route
| artifact | format | size | hashes |
|---|---|---|---|
| v1.55.0.zip | zip | 934.3 KiB |
blake3-24 036a2c277778363a92d4e2a38b67a32904b77aafbb0fff4e
sha256 79d5ab3537dad6866d00292402a2821592de9c4ad73105b60305a84f643f0551
sha1 623605c19b4f2d92744c36c35d7d8a03ebedac9e
|
install
bazel
http_archive(
name = "nats-go",
urls = ["https://ratatoskr.space/pkg/nats-go/v1.55.0.tar.gz"],
integrity = "sha256-jQMoGVkQ0ipBpDx1M+v+b1sRAEBeOTsW2/MJB9WqS1o=",
strip_prefix = "nats-go-v1.55.0",
)
zig
.url = "https://ratatoskr.space/pkg/nats-go/v1.55.0.tar.gz",
go
GOPROXY=https://ratatoskr.space GOSUMDB=off go get ratatoskr.space/pkg/nats-go@v1.55.0
install via yggdrasil mesh
bazel
http_archive(
name = "nats-go",
urls = ["http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go/v1.55.0.tar.gz"],
integrity = "sha256-jQMoGVkQ0ipBpDx1M+v+b1sRAEBeOTsW2/MJB9WqS1o=",
strip_prefix = "nats-go-v1.55.0",
)
zig
.url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go/v1.55.0.tar.gz",
go
GOPROXY=http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg GOSUMDB=off GOINSECURE=14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/* go get 14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/nats-go@v1.55.0