Commit Graph

5589 Commits

Author SHA1 Message Date
Neil Twigg
1f9ddf2bbd Add Raft goroutine labels, tweak logging
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-16 11:15:06 +01:00
Derek Collison
9781025b40 Fix for data race accessing consumer assignment
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-15 16:21:12 -07:00
Derek Collison
a5344c099f AuthCallout request should include TLS data when client is NATS WS client (#4544)
Make sure the client handshake flag is set when TLS handshake is made as
part of WebSocket connection/upgrade (notionally HTTPS) rather than as
part of the NATS protocol TLS initiation chain. AuthCallout tests the
flag when building the data for the AuthCallout service request.

Added AuthCallout unit test for NATS WS client auth that requires the
TLS data.
2023-09-15 15:56:12 -07:00
Todd Beets
aed99441c6 Use preferred value tests (equal, not equal) rather than booleans for better fail logs 2023-09-15 14:41:41 -07:00
Todd Beets
7b0a12d7da Add *tls.Conn safe type check as some black box unit tests override the natural underlying type for test purposes which would otherwise cause a panic 2023-09-15 13:52:41 -07:00
Todd Beets
40cf145ee6 Map both 127.0.0.1 and 127.0.1.1 to localhost for HTTPS server host validate 2023-09-15 13:13:24 -07:00
Todd Beets
75d2ddb26b AuthCallout request should include TLS data when client is NATS WS client 2023-09-15 12:36:34 -07:00
Derek Collison
0af378cf85 Bump to 2.10.0-RC.4
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-15 08:54:27 -07:00
Derek Collison
097e4097d1 Allow longer times due to travis slowdowns
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-15 08:52:50 -07:00
Derek Collison
f2e7ed91cb Fix for panic in consumer, needed to recheck if consumer was closed
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-15 08:40:21 -07:00
Waldemar Quevedo
76cbef79cc Bump to 2.10.0-RC.3
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2023-09-14 12:11:09 -07:00
Derek Collison
22f40eafa0 Add in jitter in case there are many that all try to cleanuo at the same time
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-14 11:24:32 -07:00
Derek Collison
392f25b6da Fix for data race and adjustment to do a backoff on making sure consumers are cleaned up.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-14 11:21:11 -07:00
Waldemar Quevedo
db0faf4538 flake: Fix TestJetStreamConsumerAckFloorFill
Can sometimes fail the first time checking for the ack floor
but fine after checking again.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2023-09-14 09:31:38 -07:00
Neil Twigg
f38faafbc9 Bump to 2.10.0-RC.2
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-14 16:35:36 +01:00
Neil
46361e86a3 Fix leaking timers in stream sources (#4532)
Repeated calls to `scheduleSetSourceConsumerRetry` could end up creating
multiple timers for the same source, which would eventually schedule
even more timers, which would result in runaway CPU usage. This PR
instead bounds to one timer per source per stream.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-14 16:32:36 +01:00
Neil Twigg
904f4c388e De-flake TestJetStreamClusterAccountPurge by waiting for account to exist
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-14 11:40:30 +01:00
Neil Twigg
6f3f544841 Fix leaking timers in stream sources
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-14 10:30:24 +01:00
Derek Collison
787f6acf31 Fix for a call into fs.recalculateFirstForSubj() from fs.recalculateFirstForSubj() that did not lock the mb properly.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-13 15:35:34 -07:00
Neil Twigg
505190266a Bump to 2.10.0-RC.1
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-13 17:22:30 +01:00
Neil
59bc094e86 [FIXED] Increased AckWait in TestMQTTQoS2RetriesPublish, TestMQTTQoS2RetriesPubRel (#4518)
TestMQTTQoS2RetriesPublish to 100ms, and in TestMQTTQoS2RetriesPubRel to
50ms.

A lesser value caused another PUBLISH to be fired while the test was
still processing the final QoS2 flow. Reduced the number of retries we
wait for to make the test a little quicker.
2023-09-13 11:49:17 +01:00
Piotr Piotrowski
e08442fbfc flake: Fixes TestServerOperatorModeUserInfoExpiration
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
2023-09-13 11:57:53 +02:00
Derek Collison
58b5fc4abf Fix for a flapper
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 17:19:30 -07:00
Derek Collison
3407eda769 Bump to 2.10.0-beta.56
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 15:52:00 -07:00
Derek Collison
244ff4489c Fix for panic from a bug in selecting a block and an index when num blocks > 32 and we used new binary search in NumPending().
The reason would be that we were not accounting for gaps as mb.first.seq can move. The behavior should always return a valid index and mb if seq is inclusive of range from first to last.
The panic could orphan held locks for filestore, consumer and possibly stream.

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 15:20:09 -07:00
Derek Collison
f18e06bd57 [FIXED] Move test fix - TestJetStreamSuperClusterMovingStreamsAndConsumers/R3 (#4519)
The default timeout for JetStream API calls is 10s, so in the case where
we determine that we are the leader, but the stream info endpoint has
not registered with the server we are connected to, the stream info call
could fail and we would exhaust the whole checkFor since we would stay
in one call for 10s.

Fix is to override and make multiple attempts possible for the checkFor
loops.

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 11:57:26 -07:00
Derek Collison
edbaa57e87 Fixes for move test.
The default timeout for JetStream API calls is 10s, so in the case where we determine that we are the leader, but the stream info endpoint has not registered with the server we are connected to, the stream info call could fail and we would exhaust the whole checkFor since we would stay in one call for 10s. Fix is to override and make multiple attempts possible.

Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 11:38:35 -07:00
Lev Brouk
b60df6ec2d Increased AckWait in TestMQTTQoS2RetriesXXX
TestMQTTQoS2RetriesPublish to 100ms, and in TestMQTTQoS2RetriesPubRel to 50ms.

A lesser value caused another PUBLISH to be fired while the test was still processing the final QoS2 flow. Reduced the number of retries we wait for to make the test a little quicker.
2023-09-12 11:38:24 -07:00
Lev
1acc800778 [FIXED] Increased MQTT test R/W timeout from 4 to 5s (TestMQTTSubPropagation) (#4517)
Tracing the connect (ack?) read times in `TestMQTTSubPropagation` showed
that they come in the 2-3s range during normal execution, and it appears
that they occasionally exceed the 4s timeout.

I am not sure exactly why MQTT CONNECT takes such a long time, but as
the name of the test suggests, perhaps it has to do with session
propagation in a cluster.
2023-09-12 11:31:16 -07:00
Derek Collison
292e42d528 Better fix for flapping test - TestJetStreamClusterStaleReadsOnRestart (#4516)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 08:32:16 -07:00
Derek Collison
0308cbb372 Fix for spelling
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 07:52:17 -07:00
Derek Collison
3f80348a16 Fix for data race in accessing rg.node
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 07:43:14 -07:00
Derek Collison
8e2c30a75b Better fix for flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-12 06:54:36 -07:00
Neil Twigg
3becc840d9 Allow more time in TestFileStoreNumPendingLargeNumBlks, improve logging on failure
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-12 11:02:43 +01:00
Derek Collison
eed5fd8a73 Allow time for the 3rd replica to be current
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-11 21:54:58 -07:00
Derek Collison
e72bb957fd [FIXED] Data race accessing mirror tr (#4512)
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-11 21:31:47 -07:00
Derek Collison
349158a349 Fix for datarace accessing mirror tr
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-11 21:12:15 -07:00
Derek Collison
970dfab52f Need a flush to make sure INFO processed
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-11 20:39:50 -07:00
Derek Collison
9531611feb Add in utility to detect and delete any NRG orphans.
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-11 19:15:12 -07:00
Derek Collison
7d041da3c8 Fix for datarace on clfs
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-10 11:07:27 -07:00
Derek Collison
5def0a99b4 _EMPTY_ replacements
Signed-off-by: Derek Collison <derek@nats.io>
2023-09-10 10:22:22 -07:00
Waldemar Quevedo
93072c333b Allow more time in TestNoRaceSeqSetEncodeLarge (#4505)
In CI this is typically < 700uS, but quite often > 500uS.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-09 10:46:36 -07:00
Waldemar Quevedo
eb06efff15 [FIXED] Skip TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe, see c… (#4506)
`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.
2023-09-09 10:46:18 -07:00
Derek Collison
e4867455c2 Fix TestNoRaceJetStreamSparseConsumers (#4503)
This is the same fix as in
https://github.com/nats-io/nats-server/pull/4500

This means it adds `StallWait` to `PublishAsync`, as that's seems to be
the only
reason why this test fails.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-09-08 10:01:24 -07:00
Lev Brouk
64c34c4b5d [FIXED] Skip TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe, see comments 2023-09-08 09:42:51 -07:00
Neil Twigg
e382b52ad8 Allow more time in TestNoRaceSeqSetEncodeLarge
In CI this is typically < 700uS, but quite often > 500uS.

Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-08 16:36:28 +01:00
Neil Twigg
ede9a6cdfe Improve TestJetStreamAccountImportJSAdvisoriesAsStream
Signed-off-by: Neil Twigg <neil@nats.io>
2023-09-08 15:15:18 +01:00
Tomasz Pietrek
7b54a1e6a1 Fix TestNoRaceJetStreamSparseConsumers
This is the same fix as in https://github.com/nats-io/nats-server/pull/4500

This means it adds `StallWait` to `PublishAsync`, as that's seems to be the only
reason why this test fails.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
2023-09-08 11:34:16 +02:00
Todd Beets
5519308047 Re-order auth.go imports following server convention. 2023-09-07 15:20:35 -07:00
Todd Beets
006f7a77f9 Don't log error in legitimate nkey auth callout config case (4479). 2023-09-07 11:21:55 -07:00