github nats-io/nats.net v2.6.8
NATS .NET v2.6.8

latest release: v2.7.0-preview.5
one day ago

Important Bug Fix Release

This is an important bug fix release for Object Store users and JetStream publish behavior. Object store bug was causing object corruption, for example under load or during cluster changes when the JetStream publish request was automatically retried reusing a rented buffer. With this fix we also squashed a JetStream bug where JetStream publish was retrying automatically on a timeout again potentially publishing a message twice.

Object Store Corruption

While putting an object, object store chunks were being retired for publishing to JetStream (Object Store uses JetStream) under certain conditions. When that happened, combined with a buffer management bug, there were cases where object chunks were published twice or with data containing parts of other messages due to mismanagement of rented buffers. Since the meta data was published correctly, the issue was seen when trying to get the object (with any NATS client) as digest mismatch. This avoided using the corrupted objects but they stayed in the stream.

JetStream Double Publish Risk

When publishing to JetStream NATS .NET client automatically retries (twice by default, after 250ms) on receiving a 503 response from the server. However in addition to that the client also retried when receiving no response from the server within two seconds of timeout which potentially publishes messages twice.

See PRs #937 and #942 for more details.

Huge thanks to @MiloszKrajewski for his meticulous analysis and fixing the object store put buffer bug ❤️

What's Changed

  • Don't suppress SystemExceptions in NatsSubBase.ReceiveAsync by @desmondgc in #938
  • Fix Object Store and JetStream publish retry logic by @mtmk in #937
  • fix: Do not transfer ownership of chunk buffer (issue #917) by @MiloszKrajewski in #942

New Contributors

Full Changelog: v2.6.7...v2.6.8

You can download the released packages from NuGet: https://www.nuget.org/packages/NATS.Net/2.6.8

Don't miss a new nats.net release

NewReleases is sending notifications on new releases.