Commit Graph

3076 Commits

Author SHA1 Message Date
Derek Collison
400b044ea0 Bump version
Signed-off-by: Derek Collison <derek@nats.io>
2020-08-05 10:54:56 -07:00
Ivan Kozlovic
4d0e50209c Merge pull request #1549 from nats-io/reload_auth_service_imp_deadlock
[FIXED] Deadlock on config reload with routes and account service import
2020-08-03 15:54:36 -06:00
Ivan Kozlovic
f11931314f [FIXED] Deadlock on config reload with routes and account service import
Related to #1544

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-08-03 15:45:21 -06:00
Ivan Kozlovic
a1484931b8 Merge pull request #1548 from nats-io/syssubscribe_races
Fix sysSubscribe races
2020-08-03 15:36:07 -06:00
Ivan Kozlovic
22833c8d1a Fix sysSubscribe races
Made changes to processSub() to accept subscription properties,
including the icb callback so that it is set prior to add the
subscription to the account's sublist, which prevent races.
Fixed some other racy conditions, notably in addServiceImportSub()

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-08-03 14:59:00 -06:00
Ivan Kozlovic
94fee0eb01 Merge pull request #1547 from nats-io/rework_close_connection
Rework closeConnection()
2020-08-03 11:01:15 -06:00
Ivan Kozlovic
c620175353 Rework closeConnection()
This change allows the removal of the connection and update of
the server state to be done "in place" but still delay the flushing
of and close of tcp connection to the writeLoop. With ref counting
we ensure that the reconnect happens after the flushing but not
before the state has been updated.

Had to fix some places where we may have called closeConnection()
from under the server lock since it now would deadlock for sure.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-31 15:30:17 -06:00
Ivan Kozlovic
9bad202d5d Merge pull request #1546 from nats-io/systemQ
Deliver to all non remote queue subscriber instead of kind == CLIENT
2020-07-31 14:45:03 -06:00
Matthias Hanel
b759282407 Removing gateway as this condition won't be happening
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-07-31 16:26:33 -04:00
Matthias Hanel
e089fae7fb Deliver to all non remote queue subscriber instead of kind == CLIENT
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-07-31 15:18:26 -04:00
Ivan Kozlovic
33d41c7447 Merge pull request #1545 from nats-io/fix_1543
[FIXED] Possible deadlock with solicited leafnodes when cluster conflict
2020-07-31 09:11:31 -06:00
Ivan Kozlovic
96ccf91566 [FIXED] Possible deadlock with solicited leafnodes when cluster conflict
We cannot call c.closeConnection() under the server lock because
closeConnection() can invoke server lock in some cases.

Created a test that should run without `-race` to reproduce the deadlock
(which it does) but sometimes would fail because cluster would not be
formed. This unconvered an issue with conflict resolution which
test TestRouteClusterNameConflictBetweenStaticAndDynamic() can reproduce
easily. The issue was that we were not updating a dynamic name with
the remote if the remote was non dynamic.

Resolves #1543

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-30 18:45:36 -06:00
Ivan Kozlovic
60f9256d40 Merge pull request #1542 from nats-io/websocket_no_tls
Websocket: add option to disable TLS
2020-07-29 18:11:10 -06:00
Ivan Kozlovic
20a67a5be8 Websocket: add option to disable TLS
The new option Websocket.NoTLS would have to be set to true
to disable the server check that enforces TLS configuration.

Resolves #1529

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-29 17:33:02 -06:00
Derek Collison
6e1a892740 Merge pull request #1531 from ripienaar/max_consumers
allow max consumers to be set
2020-07-29 09:09:11 -07:00
Ivan Kozlovic
e2333641f9 Merge pull request #1539 from nats-io/silent_sub_loss_in_cluster
Remove unnecessary account fetch from remote remove functions
2020-07-28 09:31:18 -06:00
Matthias Hanel
3da66ad80d Remove unnecessary account fetch from remote remove functions
Changed: removeReplySub, removeRemoteSubs and processRemoteUnsub

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-07-28 11:00:17 -04:00
Ivan Kozlovic
fbab1daf06 Merge pull request #1538 from nats-io/silent_sub_loss_in_cluster
[Fixed] Skip fetch when a non config based account resolver is used
2020-07-27 17:29:09 -06:00
Matthias Hanel
946e8415a0 Incorporating review comments 2020-07-27 19:19:43 -04:00
Matthias Hanel
00faefec06 Reduce usage of tmpAccounts to only location where it is needed imports
On import handle it with priority as in non recursive situations, it
won't be present.
2020-07-27 17:38:39 -04:00
Matthias Hanel
37692d2cf9 [Fixed] Skip fetch when a non config based account resolver is used
Resolves #1532

Instead of the fetched account we create a dummy account that is
expired. Any client connecting will trigger a fetch of the actual
account jwt.

This also avoids one fetch, thus the unit test was changed to reflect
this.
Unlike other resolver the memory resolver does not depend on external
systems. It is purely based on server configuration. Therefore, fetch
can be done and not finding an account means there is a configuration issue.
2020-07-27 17:36:55 -04:00
Ivan Kozlovic
b71ba6e223 Merge pull request #1536 from nats-io/untrusted_account_memory
Ensuring that an untrusted account is not held in memory
2020-07-27 13:50:44 -06:00
R.I.Pienaar
b80e40340e allow account limits to be applied to unlimited streams
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-07-27 19:02:37 +02:00
Matthias Hanel
99921725a9 Ensuring that an untrusted account is not held in memory
The check that an account has to be signed by a configured operator is
done after fetch as well. As a consequence an account claim will never
become an Account in memory.
The original check during client or leaf authentication is left in
place.

Adding unit tests.
Modifying existing tests to not rely on an account but it's name instead.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-07-27 11:59:49 -04:00
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
Derek Collison
ec34552a88 Merge pull request #1534 from nats-io/ratelimit
Add in push based consumer rate limits
2020-07-24 13:25:10 -05: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
R.I.Pienaar
ca0dc72841 allow max consumers to be set
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-07-24 17:30:41 +02:00
Ivan Kozlovic
aa67270ea5 Merge pull request #1530 from nats-io/fix_1527
[FIXED] Queue subscriptions not able to receive system events.
2020-07-23 12:40:38 -06: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
70769b1d2d Merge pull request #1524 from nats-io/jsfix
Fix for stream delete with many consumers
2020-07-22 09:55:45 -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
449f7f15cb Merge pull request #1523 from nats-io/add_cmd_line_cluster_name
Added -cluster_name command line option
2020-07-21 16:45:21 -06: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
Derek Collison
1d394fbd28 Merge pull request #1522 from nats-io/adr-ldm
adr describing new `ldm` field in the `INFO` protocol.
2020-07-20 17:45:53 -05:00
Alberto Ricart
d2c50be093 adr describing new ldm field in the INFO protocol. 2020-07-20 10:41:06 -05:00
Derek Collison
862dfcde0e Merge pull request #1521 from ripienaar/unlimited_accounts
ensure unlimited account limits are calculated correctly
2020-07-20 07:50:17 -05: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
4a4a36f9ec Merge pull request #1517 from nats-io/fix_1515
[FIXED] Handling of gossiped URLs
2020-07-16 12:56:02 -06: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
8312f3fb6d Merge pull request #1512 from nats-io/eoupdate
More checks on duplicate window config, signal in PubAck if duplicate
2020-07-10 07:12:33 -07: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