We do not expect this condition at all but did see it in the wild, so
this will detect and cleanup. Will run on same timer (2m) as general
health checks run from `monitorCluster()`
Signed-off-by: Derek Collison <derek@nats.io>
`TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe` was flaky on
TravisCI.
At this point it was there to illustrate a design issue with MQTT 3.1.1
QoS support, and much of it is disabled since it'd be failing anyway.
Disabling the test until it can be _fully_ applicable/enabled.
`Resolves #4479 `
In AuthCallout server-config system, a spurious error message would be
generated on server reload in the edge case that the AuthCallout user is
an NKEY and both User and NKEY account members are defined in the
config.
Calls to `filteredStateLocked` can mutate the per-subject state by
recalculating the first sequences. Doing so under a read-only lock can
lead to race conditions, so switch the call sites out to write locks
instead.
Signed-off-by: Neil Twigg <neil@nats.io>
The `streamSnapshot` function was not holding the filestore lock while
resetting and using the hasher. This created a data race and also
resulted in flakes in `TestFileStoreSnapshot`.
Signed-off-by: Neil Twigg <neil@nats.io>
- Use Go 1.21 in nightlies
- Both rand.Seed and rand.Read are both deprecated, remove its use to
fix staticcheck errors
```go
server/client.go:95:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative
has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value.
Programs that call Seed with a known value to get a specific sequence of results should use
New(NewSource(seed)) to obtain a local random generator. (staticcheck)
server/jetstream_test.go:20399:2: SA1019: rand.Read has been deprecated since Go 1.20
because it shouldn't be used: For almost all use cases, crypto/rand.Read is more appropriate. (staticcheck)
```
This test flakes quite often on the final consumer info check because of
one consumer reporting `PushBound` and the other not. By clearing both,
this should clear up the disagreement.
Signed-off-by: Neil Twigg <neil@nats.io>
In +Go 1.20, the x509.HostnameError changed to be wrapped in a
tls.CertificateVerificationError so sometimes the name would not
be reset.
This would make the `TestGatewayTLSMixedIPAndDNS` test flake sometimes.
Signed-off-by: Waldemar Quevedo <wally@nats.io>
- [x] Branch rebased on top of current main (`git pull --rebase origin
dev`)
- [x] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [ ] Build is green in Travis CI
### Changes proposed in this pull request:
Removed `qos2` reference from the MQTT outgoing stream name and
subjects.
Rationale: As I was reviewing the documentation and thinking how to move
forward with MQTT, I am inclined to use the `$MQTT_out` stream and
session-specific consumers (as opposed to subscription-specific) for all
QOS-related packet delivery and PI persistence. I think I will be able
to repurpose it "as is", so proposing the generic name change.
Since these (stream, consumer, subscriptions) are newly introduced in
https://github.com/nats-io/nats-server/pull/4349 and have not yet been
released, this is a safe change.