Commit Graph

1829 Commits

Author SHA1 Message Date
Ivan Kozlovic
00eb20b293 Merge pull request #1533 from nats-io/silent_sub_loss_in_cluster
Adding unit test demonstrating silent subscription loss
2020-07-24 14:37:35 -06:00
Derek Collison
ad8d768d34 bumped beta version
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-24 11:25:59 -07:00
Matthias Hanel
59af53c452 Adding unit test demonstrating silent subscription loss
This test uses is skipped for now

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-07-24 13:21:27 -04:00
Derek Collison
154d4303a9 Add in consumer rate limits
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-24 10:11:32 -07:00
Ivan Kozlovic
dbf962f958 [FIXED] Queue subscriptions not able to receive system events.
The issue was caused by the kind of connections being checked.

Resolves #1527

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-23 11:38:43 -06:00
Derek Collison
9514576b72 Merge pull request #1526 from nats-io/no-header-support-option
added 'no_header_support' config option mapping to NoHeaderSupport
2020-07-22 12:13:30 -05:00
Alberto Ricart
2047c791ea added option so clients can test if a server disables header support 2020-07-22 10:11:44 -05:00
Derek Collison
48b2335cbf Fix for stream delete with many consumers - https://github.com/nats-io/jetstream/issues/260
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-22 07:35:38 -07:00
Ivan Kozlovic
0ce84a83c5 Added -cluster_name command line option
This is handy for client libraries that start the server as
external executable and pass command line arguments. Without
specifying the cluster name, routes can take time to establish
and cause some tests to fail.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-21 15:50:24 -06:00
R.I.Pienaar
5037f00b30 ensure unlimited account limits are calculated correctly
Previously unlimited accounts - ones who inherit server values - would
be unable to publish any messags at all

Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-07-20 10:46:34 +02:00
Ivan Kozlovic
b9764db478 Renamed gossipURLs type and moved its declaration to util.go
Also made the add/remove/getAsStringSlice receiver for this type.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-16 11:22:58 -06:00
Ivan Kozlovic
9b0967a5d1 [FIXED] Handling of gossiped URLs
If some servers in the cluster have the same connect URLs (due
to the use of client advertise), then it would be possible to
have a server sends the connect_urls INFO update to clients with
missing URLs.

Resolves #1515

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-15 17:39:12 -06:00
Derek Collison
177ca51356 More checks on duplicate window config, signal in PubAck if duplicate
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-10 07:02:34 -07:00
Waldemar Quevedo
6ba1559598 Merge pull request #1510 from nats-io/leafnode-no-op-reload
Fix config reload when no changes for leafnode remotes
2020-07-09 19:46:51 -07:00
Ivan Kozlovic
29d5fdc483 Merge pull request #1511 from nats-io/no_responders_should_not_use_sendprotonow
Fixed no_responders use of sendProtoNow()
2020-07-09 18:22:07 -06:00
Ivan Kozlovic
4d495104de Fixed no_responders use of sendProtoNow()
The call sendProtoNow() should not normally be used (only when
setting up a connection when the writeloop is not yet started and
server needs to send something before being able to start the
writeLoop.

Instead, code should use enqueueProto(). For this particular
case though, use queueOutbound() directly and add to the
producer's pcd map.

Also fixed other places where we were using queueOutbound() +
flushSignal() which is what enqueueProto is doing.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-09 17:55:14 -06:00
Derek Collison
ad21074177 Merge pull request #1508 from nats-io/eo
Provide exactly once semantics
2020-07-09 16:27:56 -07:00
Derek Collison
2b577b5197 Recover dedupe in memory structures on stream recovery
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-09 16:13:20 -07:00
Waldemar Quevedo
edb611fad4 Fix config reload when no changes for leafnode remotes
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-07-09 14:33:08 -07:00
Derek Collison
ba9dd37595 Rename json field
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-09 08:41:32 -07:00
Derek Collison
e750af84c0 Redo for fast exit when key not found
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-08 17:42:16 -07:00
Derek Collison
b74c2eb2c4 Provide exactly once semantics
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-08 16:56:52 -07:00
Ivan Kozlovic
bfe4eb68b2 Merge pull request #1506 from nats-io/fix_1505
[FIXED] Connection name in log statement for some IPv6 addresses
2020-07-08 14:59:25 -06:00
Ivan Kozlovic
4ea3f9c57e [FIXED] Handling or real duplicate subscription
That is, if the server receives "SUB foo 1" more than once from
the same client, we would register in the client map this subscription
only once, and add to the account's sublist only once, however we
would have updated shadow subscriptions and route/gateway maps for
each SUB protocol, which would result in inability to send unsubscribe
to routes when the client goes away or unsubscribes.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-08 14:19:32 -06:00
Ivan Kozlovic
2c8bf520d1 [FIXED] Connection name in log statement for some IPv6 addresses
If an IPv6 address contains some "%" characters, this was causing
the connection name in log statement to mess up the Sprintf formatting.
The solution is to escape those "%" characters.

Resolves #1505

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-08 10:17:14 -06:00
Derek Collison
735e06b9b9 Merge pull request #1503 from nats-io/jsbug
Pending timers could go negative, this is a fix for #1502
2020-07-07 05:38:21 -07:00
Ivan Kozlovic
9288283d90 Fixed accept loops that could leave connections opened
This was discovered with the test TestLeafNodeWithGatewaysServerRestart
that was sometimes failing. Investigation showed that when cluster B
was shutdown, one of the server on A that had a connection from B
that just broke tried to reconnect (as part of reconnect retries of
implicit gateways) to a server in B that was in the process of shuting down.
The connection had been accepted but createGateway not called because
the server's running boolean had been set to false as part of the shutdown.
However, the connection was not closed so the server on A had a valid
connection to a dead server from cluster B. When the B cluster (now single
server) was restarted and a LeafNode connection connected to it, then
the gateway from B to A was created, that server on A did not create outbound
connection to that B server because it already had one (the zombie one).

So this PR strengthens the starting of accept loops and also make sure
that if a connection (all type of connections) is not accepted because
the server is shuting down, that connection is properly closed.

Since all accept loops had almost same code, made a generic function
that accept functions to call specific create connection functions.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-06 17:03:19 -06:00
Derek Collison
aecdca874f Pending timers could go negative, this is a fix for #1502
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-06 14:59:05 -07:00
Ivan Kozlovic
27540ee255 Fixed some flappers
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-03 11:30:48 -06:00
Ivan Kozlovic
342acb0fe7 Fixed async client tests
In some tests, async clients are used with a running server (which
was not original intent). This resulted in the client writeLoop
to be started twice.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-01 15:53:08 -06:00
Derek Collison
1004bd5cae version bump
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-01 08:13:24 -07:00
Derek Collison
ff8dfa8d35 Reordering for inbound processing
Signed-off-by: Derek Collison <derek@nats.io>
2020-07-01 07:33:34 -07:00
Derek Collison
06ca580334 Update write deadline, client processing and slow proxy
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-30 16:41:01 -07:00
Derek Collison
2a799e7f5f Track destination leafnode status
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-26 11:18:11 -07:00
Derek Collison
f41171c146 Merge pull request #1493 from nats-io/lnoc
Properly support leadnode clusters.
2020-06-26 10:36:47 -07:00
Derek Collison
920617d64a Updates based on feedback
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-26 10:29:53 -07:00
Derek Collison
e1adb58b06 Support clustername change on reload, fixes #1492
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-26 09:48:54 -07:00
Derek Collison
6c805eebc7 Properly support leadnode clusters.
Leafnodes that formed clusters were partially supported. This adds proper support for origin cluster, subscription suppression and data message no echo for the origin cluster.

Signed-off-by: Derek Collison <derek@nats.io>
2020-06-26 09:03:22 -07:00
Derek Collison
797dd1a8c9 bump version
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-19 06:14:45 -07:00
Derek Collison
120402241a Fix for #1486
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-18 21:04:34 -07:00
Derek Collison
9bf85aca2b Merge pull request #1483 from nats-io/fs_bug
Run expiration only once at a time and double check cache, fixes #1482
2020-06-18 14:07:33 -07:00
Derek Collison
95462cde57 Fix for memory expiration and age timer
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-18 14:02:11 -07:00
Derek Collison
c7e4d8b194 Avoid data race on cluster name
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-18 13:17:50 -07:00
Ivan Kozlovic
dc88143b82 Merge pull request #1477 from pas2k/ws_cookie_auth
[ADDED] Cookie JWT auth for WebSocket
2020-06-18 14:01:14 -06:00
Ivan Kozlovic
c86bb0b3f2 Merge pull request #1481 from nats-io/filter_ping
Add filtering by name and cluster to PING events
2020-06-18 13:45:07 -06:00
Derek Collison
a13402cd01 Run expiration only once at a time and double check cache, fixes #1482
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-18 12:14:25 -07:00
Pavel Khlebovich
d5eb9ff6f2 Support Cookie JWT auth via WebSocket 2020-06-18 19:27:42 +03:00
Derek Collison
fa744fdcda Proper no response
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-17 15:47:55 -07:00
Derek Collison
6c69c6ae48 Off by one, and need to send in place
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-17 15:32:26 -07:00
Matthias Hanel
1309605563 Filter by host and json name change
Also added more unit tests

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-06-17 15:10:41 -04:00