Commit Graph

1175 Commits

Author SHA1 Message Date
antmanler
ca773bf07b Make sure Sublist.All collect all subscriptions 2019-07-10 21:41:44 +08:00
Derek Collison
074c87d49e Merge pull request #1060 from nats-io/gr
Make sure we route  responses across leafnodes
2019-07-08 17:07:57 -07:00
Derek Collison
49707317a1 Make sure we route responses across leafnodes
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-08 16:20:40 -07:00
Derek Collison
f76a6b9a5c When a bound account's maxpayload is not the same make sure we send it to clients that can do async INFO.
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-08 15:20:23 -07:00
Derek Collison
d7e5554630 Grab opts under correct lock, make cache decision more explicit
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-02 09:31:54 -07:00
Derek Collison
8168aa1f81 Allow sublist cache do be disabled globally
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-02 07:34:02 -07:00
Derek Collison
3c3e97f729 Fold under cache conditional
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-02 06:06:53 -07:00
Derek Collison
acc1031705 Protect stats when no cache is present
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-02 05:47:39 -07:00
Ivan Kozlovic
156511bba7 [FIXED] Check of maxpayload could be bypassed if size overruns int32
One could craft a PUB protocol to cause server to panic. This can
happen if the size in the PUB protocol overruns an int32.

(note that if authorization is enabled, the user would need to
authenticate first, limiting the impact).

Thank you to Aviv Sasson and Ariel Zelivansky from Twistlock
for the security report!

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-01 15:06:08 -06:00
Derek Collison
e83e0a7f5c Merge pull request #1048 from nats-io/ping
Stager first ping from server and suppress pings if a ping was received.
2019-07-01 12:06:32 -07:00
Derek Collison
a6cef5b584 spaces fix
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-01 12:03:45 -07:00
Derek Collison
e11a959584 Send ping when RTT update needed
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-01 11:58:06 -07:00
Derek Collison
ce22bc87a4 Make ReadOperatorJWT public for embedded use case. Fixes #1050
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-01 11:14:21 -07:00
Derek Collison
5a89c14eb9 Change to JoinHostPort
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-01 09:37:03 -07:00
Derek Collison
8a3db71ad5 Updates from comments
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-01 08:47:13 -07:00
Derek Collison
0f20592fb3 Made leafnode connect a Debugf to be consistent, added first connect Noticef.
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-29 19:11:02 -07:00
Derek Collison
100d0d2b02 Use default port for leafnode remote if not specified
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-29 17:50:21 -07:00
Derek Collison
ebd4deb8b9 Stager first ping from server and suppress pings if a ping was received.
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-29 15:43:15 -07:00
Derek Collison
2db76bde33 version bump [ci skip]
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-24 17:17:13 -07:00
Derek Collison
5b42b99dc1 Allow operator to be inline JWT. Also preloads just warn on validation issues, do not stop starting or reloads.
We issue validation warnings now to the log.

Signed-off-by: Derek Collison <derek@nats.io>
2019-06-24 16:46:22 -07:00
Derek Collison
6f49f76efb Fix for #1043 [ci skip]
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-21 08:58:18 -07:00
Waldemar Quevedo
8147adc1b0 Add support to extend leafnodes remote tls timeout
Bump default TLS timeout for leafnode connections

Add checks for when cert_file or key_file are missing in TLS config

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-06-14 08:04:44 -07:00
Derek Collison
d1a782e014 Messages not distributed evenly when sourced from leafnode.
When messages came from a leafnode there were not being distributed evenly to the destination cluster.

Signed-off-by: Derek Collison <derek@nats.io>
2019-06-11 20:37:49 -07:00
Ivan Kozlovic
4ce5217242 Prepare for release 2.0.0
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-04 22:15:23 -06:00
Ivan Kozlovic
6382ba8d77 Release v2.0.0-RC19
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-04 09:05:00 -06:00
Ivan Kozlovic
ed1901c792 Update go.mod to satisfy v2 requirements
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-03 19:45:47 -06:00
Derek Collison
2a8e630bf1 Fix for leafnode and dq selection over GWs
Signed-off-by: Derek Collison <derek@nats.io>
2019-06-01 16:43:54 -07:00
Derek Collison
adba6dc023 Add in leafnode bound account events for accounting
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-31 16:58:27 -07:00
Derek Collison
d246359dc8 Merge pull request #1028 from nats-io/leaf_gw_si
Bug fix for service import with leafnodes and gws
2019-05-31 11:29:33 -07:00
Derek Collison
3cf6f6a5d2 Bug fix for service import with leafnodes and gws
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-31 11:22:02 -07:00
Ivan Kozlovic
37f4e71246 Fixed race due to use of byte slice instead of string
The go routine that is started during interest mode switch was
using the accName (which was a byte slice) instead of account,
which was a string copy of that byte slice. It meant that when
printing the notice, the underlying buffer may have be overwriten
by the readloop.

Changing accName to a string - since we were doing a copy anyway,
better change it at the function param level.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-30 18:43:01 -06:00
Ivan Kozlovic
1c193452b1 Merge pull request #1026 from nats-io/switch_gw_to_interest_only_once
Switch gateway to InterestMode only once
2019-05-30 17:24:05 -06:00
Ivan Kozlovic
37b3546e7b Switch gateway to InterestMode only once
When a leafnode connection is created, the server forces all
gateway inbound connections to switch to InterestMode. Do this only
once, regardless of how many times the LN (re)connects.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-30 17:21:15 -06:00
Derek Collison
c188cb092c Merge pull request #1025 from nats-io/lf
Cleaned up logging for leafnodes
2019-05-30 16:04:36 -07:00
Derek Collison
257b670ae2 Cleaned up logging for leafnodes
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-30 15:53:14 -07:00
Ivan Kozlovic
eeffab25db Merge pull request #1024 from nats-io/allow_top_level_unknown_fields_in_process_cfg
Added a function to allow ignoring top-level unknown config option
2019-05-30 16:40:01 -06:00
Ivan Kozlovic
451d4bb05c Change name of public function
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-30 16:25:37 -06:00
Derek Collison
da938dcb1e Cleaned up debug and fixed test
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-30 14:30:35 -07:00
Ivan Kozlovic
437e16ca71 Added a function to allow ignoring top-level unknown config option
This will be required for NATS Streaming server since streaming
allows user to have NATS and Streaming specific options in same
file.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-30 15:24:39 -06:00
Derek Collison
14ade43da9 Fix for unix time flapper
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-30 10:34:38 -07:00
Derek Collison
42a7797a50 Add chunk and total bytes to slow consumer log
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-30 09:15:20 -07:00
Derek Collison
eb6689143d Merge pull request #1020 from nats-io/bug
Fix for reloadAuthorization bugs
2019-05-29 14:20:58 -07:00
Ivan Kozlovic
44554057d1 Merge pull request #1019 from nats-io/warn_readloop_busy
Print warning if code in readloop execute for more than threshold
2019-05-29 15:16:31 -06:00
Derek Collison
a94fe78c22 Check for resolver reload to no resolver
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-29 14:00:51 -07:00
Ivan Kozlovic
7f2620904c Fixed setting timer for account connection updates
The timer was not set with the proper variable, which caused the
check to always think that a new timer should be created, which
would lead to more and more timers being created which translated
to updates being sent more and more frequently.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-29 14:28:26 -06:00
Derek Collison
874f06a212 Fix bugs on reloadAuthorization
When tls is on routes it can cause reloadAuthorization to be called.
We were assuming configured accounts, but did not copy the remote map.
This copies the remote map when transferring for configured accounts
and also handles operator mode. In operator mode we leave the accounts
in place, and if we have a memory resolver we will remove accounts that
are not longer defined or have bad claims.

Signed-off-by: Derek Collison <derek@nats.io>
2019-05-29 13:19:58 -07:00
Ivan Kozlovic
33505e4849 Print warning if code in readloop execute for more than threshold
Issue a warning in readLoop if execution of code after connection
Read() until end of for loop reaches a certain threshold.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-28 18:33:48 -06:00
Derek Collison
bd589fb20c Warn on no random client
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-28 16:17:25 -07:00
Ivan Kozlovic
66f5325cee Merge pull request #1018 from nats-io/gw_log_interest_switch
Added logging of account interest mode switch for gateways
2019-05-28 15:33:06 -06:00
Ivan Kozlovic
f5991e8a2b Merge pull request #1015 from nats-io/restore_conn_error_default_attempts_to_one
Update to connect/reconnect error reports logic
2019-05-28 14:57:29 -06:00