Commit Graph

2501 Commits

Author SHA1 Message Date
Derek Collison
e843a27bba When a responder was on a leaf node and the requestor was connected to the same server as the leafnode we did not propagate the service reply wildcard properly. This fixes that.
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-10 08:35:09 -07:00
Derek Collison
64bcf9f28a Merge pull request #1331 from nats-io/leafnode_loops
Detection for loops with leafnodes.
2020-04-09 08:50:15 -07:00
Derek Collison
d70426d3f6 Do prefix test to avoid read lock if possible
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-09 08:48:04 -07:00
Derek Collison
699502de8f Detection for loops with leafnodes.
We need to send the unique LDS subject to all leafnodes to properly detect setups like triangles.
This will have the server who completes the loop be the one that detects the error soley based on
its own loop detection subject.

Otehr changes are just to fix tests that were not waiting for the new LDS sub.

Signed-off-by: Derek Collison <derek@nats.io>
2020-04-08 20:00:40 -07:00
Derek Collison
743c6ec774 Merge pull request #1327 from nats-io/leaf_staggered
This commit allows new servers in a supercluster to be informed of accounts with leafnodes.
2020-04-08 10:57:49 -07:00
Derek Collison
82f585d83a Updated to also resend leafnode connect on GW connect via first INFO
Signed-off-by: Derek Collison <derek@nats.io>
2020-04-08 09:55:19 -07:00
Derek Collison
43fbe0ffed This commit allows new servers ina supercluster to be informed of accounts with active leafnode connections.
This is needed to put those accounts into interest only mode for inbound gateway connections. Also added code
to make sure we were doing proper account tracking and would track the global account as well, which used to
be excluded.

Fixes #977

Signed-off-by: Derek Collison <derek@nats.io>
2020-04-07 16:22:15 -07:00
Ivan Kozlovic
43d67424aa Merge pull request #1326 from nats-io/add_leafnode_remote_hub_property
[ADDED] Leafnode remote's Hub option
2020-04-07 14:34:59 -06:00
Ivan Kozlovic
76e8e1c9b0 [ADDED] Leafnode remote's Hub option
This allows a node that creates a remote LeafNode connection to
act as it was the hub (of the hub and spoke topology). This is
related to subscription interest propagation. Normally, a spoke
(the one creating the remote LN connection) will forward only
its local subscriptions and when receiving subscription interest
would not try to forward to local cluster and/or gateways.
If a remote has the Hub boolean set to true, even though the
node is the one creating the remote LN connection, it will behave
as if it was accepting that connection.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-04-07 13:42:55 -06:00
Ivan Kozlovic
8c8d6f8846 Merge pull request #1324 from nats-io/release_2_1_6
Release v2.1.6
v2.1.6
2020-03-31 12:29:22 -06:00
Ivan Kozlovic
a19dcbee2d Release v2.1.6
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-31 10:29:06 -06:00
Ivan Kozlovic
2120477735 Merge pull request #1320 from nats-io/update_deps
Update dependencies
2020-03-30 19:13:19 -06:00
Ivan Kozlovic
182e30adb6 Update dependencies
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-30 18:23:43 -06:00
Ivan Kozlovic
e63fc5f195 Merge pull request #1318 from nats-io/monitoring
[ADDED] Option to include subscription details in monitoring responses
2020-03-30 15:51:51 -06:00
Ivan Kozlovic
c2cca18b8a Merge pull request #1319 from nats-io/jwt
Using AccountResolver url from operator jwt.
2020-03-30 14:42:04 -06:00
Matthias Hanel
8a75418386 Using AccountResolver url from operator jwt.
If resolver is specified separately, it takes precedence.
nsc push automatically adds /accounts. That's why its added here too.
Operator jwt reload is not supported and is not taken into account.
On startup the AccountResolver url is checked and exits if it can't be
reached.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-30 15:43:32 -04:00
Matthias Hanel
30ba333663 Adding an option to include subscription details in monitoring responses.
Applies to routez and connz and closed connections.
Enable by specifying subs=detail

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-23 12:25:51 -04:00
Ivan Kozlovic
b46a011c87 Merge pull request #1316 from nats-io/fix_1313
Add TLS 1.3 (and new ciphers) in the tlsVersion output
2020-03-19 17:30:51 -06:00
Ivan Kozlovic
6d92410a1f Merge pull request #1308 from nats-io/loop
[FIXED] loop detection by checking for duplicate lds subscriptions
2020-03-19 17:29:48 -06:00
Ivan Kozlovic
ff920c31b3 Merge pull request #1315 from nats-io/server.gacc
Make sure server lock is held while accessing server.gacc
2020-03-19 17:29:25 -06:00
Ivan Kozlovic
d1276ad038 Add TLS 1.3 (and new ciphers) in the tlsVersion output
Also changed unknown version to "0x.." to show that value is hexa.

Resolves #1313

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-18 10:09:23 -06:00
Matthias Hanel
6f77a54118 [FIXED] loop detection by checking for duplicate lds subscriptions
This is in addition to checking if the own subscription comes back.
The duplicated lds subscription must come from a different client.
Added unit tests.
Also prefixed lds with '$' to mark it as system subject going forward.

This moves the loop detection check past other checks.
These checks should not trigger in cases where a loop is initially detected.

Fixes #1305

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-17 19:06:35 -04:00
Matthias Hanel
4aede98bcc Turn if into assignment and minimize changes by capturing s.gacc.
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-17 14:56:34 -04:00
Matthias Hanel
b0ded55b43 Make sure server lock is held while accessing server.gacc
Fixes #1314 by:
There was a data race with a write during reloadAuthorization.
Locking was added to all places where it was missing.
In situations were it appeared feasible, access was moved into existing
lock/unlock.
Where it was added, the lock order was already established.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-17 14:23:23 -04:00
Ivan Kozlovic
649af1b5c1 Merge pull request #1312 from nats-io/double-trace
Remove double trace on split buffer
2020-03-14 11:02:28 -06:00
Matthias Hanel
a57bfc4d56 Remove double trace on split buffer
The trace in question was not there prior to tracing change.
Fixes #1310, by removing it.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-13 21:06:30 -04:00
Ivan Kozlovic
6d5ac0a5e3 Merge pull request #1307 from nats-io/debug_travis_tag
Fixed TestVersionMatchesTag test
2020-03-09 10:29:39 -06:00
Ivan Kozlovic
5eebf02e5f Fixed TestVersionMatchesTag test
When no tag was set, os.Getenv("TRAVIS_TAG") would return empty string.
Travis now set TRAVIS_TAG to `''`. So check for both.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-09 10:13:32 -06:00
Ivan Kozlovic
cbc0e5848a Merge pull request #1300 from nats-io/reload
[FIXED] trace/debug/sys_log reload will affect existing clients
2020-03-09 09:48:24 -06:00
Ivan Kozlovic
b7a5ad3c5b Merge pull request #1304 from nats-io/varz
[ADDED] Value of GOMAXPROCS in /varz monitoring output
2020-03-09 09:47:50 -06:00
Matthias Hanel
2135d78634 moving maxProcs and numCores into createVarz. They do not change.
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-06 19:40:51 -05:00
Ivan Kozlovic
e5133c5a1c Merge pull request #1303 from nats-io/leaf-trace
[CHANGED] Include port in "Connected leafnode" log statement
2020-03-06 14:28:50 -07:00
Matthias Hanel
8a74add60b Include port in trace
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-06 15:44:32 -05:00
Matthias Hanel
0e2de4c9da Include value of GOMAXPROCS in /varz monitoring output
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-06 14:00:04 -05:00
Matthias Hanel
59a2102f74 Fixed RUnlock
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-06 12:17:13 -05:00
Matthias Hanel
d28ae249ed Moving client update outside of the server/gateway lock
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-06 12:00:47 -05:00
Matthias Hanel
6a1c3fc29b Moving inbound tracing to the caller (client.parse)
Tracing for outgoing operations is always done while
holding the client lock.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 17:31:18 -05:00
Matthias Hanel
fe373ac597 Incorporating comments.
c -> client
defer in oneliner
argument order

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 15:48:19 -05:00
Ivan Kozlovic
8a5b9269d7 Merge pull request #1301 from nats-io/ulimit-unittest
Modifying unit test error message to hint at ulimit -n possibly being too low
2020-03-04 12:52:15 -07:00
Matthias Hanel
68efc95a60 Modifying unit test error message to hint at ulimit -n possibly being too low
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 14:30:35 -05:00
Matthias Hanel
f5bd07b36c [FIXED] trace/debug/sys_log reload will affect existing clients
Fixed #1296, by altering client state on reload

Detect a trace level change on reload and update all clients.
To avoid data races, read client.trace while holding the lock,
pass the value into functionis that trace while not holding the lock.
Delete unused client.debug.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-04 13:54:15 -05:00
Ivan Kozlovic
51596b7be3 Merge pull request #1298 from nats-io/fix_nobuf_reuse_on_partial
[FIXED] Incorrect buffer reuse in case of partial connection write
2020-03-04 08:33:24 -07:00
Ivan Kozlovic
6f3418687b Capture original length of the first slice and updated test
Changed test to make the previous code in flushOutbound fail.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-03 19:12:42 -07:00
Ivan Kozlovic
fd8539f15f [FIXED] Incorrect buffer reuse in case of partial connection write
Added a test that demonstrates the issue and a proposed fix.

Also decrement c.out.pb if closing due to max pending limit.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-03-03 16:50:03 -07:00
Ivan Kozlovic
6465afd062 Merge pull request #1291 from nats-io/warning-debug
[FIXED] configuration warnings do not cause cmd line options to be skipped
2020-03-03 09:11:18 -07:00
Matthias Hanel
ed1255936c [FIXED] configuration warnings do not cause cmd line options to be skipped
Fixes #1290, where -DV option was skipped when config file had a warning

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 20:40:13 -05:00
Ivan Kozlovic
08d1da459b Merge pull request #1289 from nats-io/telnet
Do not send ping to presumed telnet clients until they connected/send ping
2020-03-02 18:30:45 -07:00
Matthias Hanel
a8e6af30a3 On client connect, send first ping after ping interval.
On connect message resend reset timer with setFirstPingTimer, so RTT can
be obtained quicker.

Disable short first ping in default server options for client_test.
In log_test prevent immediate scheduling by setting ping interval.

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 20:10:15 -05:00
Ivan Kozlovic
34e4c64e50 Merge pull request #1295 from nats-io/sys-trace
Adding option to enable tracing the system account. (default: false)
2020-03-02 16:48:55 -07:00
Ivan Kozlovic
fcb6dfe9a7 Merge pull request #1286 from nats-io/error-suggestion
Suggestion to improve tracing in nats-server through wrapping errors
2020-03-02 16:44:24 -07:00