Commit Graph

1003 Commits

Author SHA1 Message Date
Waldemar Quevedo
3cfc2fec29 Only consider as slow consumers clients that did CONNECT
Under some scenarios a client may hit the slow consumer
write deadline during the connecting stage, meaning that
it is possible to consider unhealthy clients could not
finish the TLS handshake as slow consumers.

With this change, we only consider as slow consumers
clients that did connect to the cluster without issues.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-12-18 23:17:57 -08:00
Derek Collison
0953016abe Bumped version
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-13 20:39:23 -08:00
Ivan Kozlovic
7c220ba700 Support for service export with wildcards
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-13 21:22:01 -07:00
Derek Collison
c87702fd7c jwt lib update, bumped version
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-12 20:43:07 -08:00
Ivan Kozlovic
519c3dab47 Add Gateway test for service import and interest only
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-11 14:44:02 -08:00
Ivan Kozlovic
1daa7d58ab Bump version
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-11 07:50:31 -08:00
Ivan Kozlovic
4719c618b3 Add some comments
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-11 07:12:33 -08:00
Ivan Kozlovic
4b70cdfc89 Fix Gateways with Service Imports
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-11 00:27:40 -08:00
Derek Collison
7fb2886098 Add total to account conn updates
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-08 18:52:04 -08:00
Derek Collison
2ab23ca307 Make public for tooling
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-08 18:33:23 -08:00
Ivan Kozlovic
efd891d2ae Fix performance degradation introduced by GW code
This impacted even non gateway traffic

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-08 17:44:32 -07:00
Derek Collison
a92ef0252c Should not send disconnect events on account $G.
Converted to authorization error events on different subject.
Add cluster name if gateways are configured and pass in INFO to clients.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-08 16:07:02 -08:00
Ivan Kozlovic
dd1b598121 Add more tracing for Gateway connect/ip
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-08 11:13:54 -07:00
Derek Collison
bb97ae7b6f Allow normal base64 sig for bare nkeys too
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-07 22:52:16 -08:00
Ivan Kozlovic
6eaa1dc351 Resolve IP if gateway listen is 0.0.0.0 or ::
Otherwise, this may be sent to servers in the cluster and to other
gateways which may result in attempt to connect to self which
in case of TLS would produce error.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-07 17:28:21 -07:00
Derek Collison
4a0a0d2d7a Allow normal base64 sig as well
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-07 16:17:09 -08:00
Derek Collison
9c667cbdf9 Set internal client to non-default, avoid race
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-07 10:32:10 -08:00
Derek Collison
be0acfd50c Merge pull request #848 from nats-io/ping
Support server ping for statusz
2018-12-07 09:19:28 -08:00
Derek Collison
c83d7f8851 Support server ping for statusz
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-07 08:42:01 -08:00
Ivan Kozlovic
c57ff0e26c Fixed possible deadlock when updating route permissions
This bug is only in master, not in any public release.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-07 09:15:05 -07:00
Ivan Kozlovic
95a5f79ac7 Added Gateway test for service import with queue group
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-06 19:13:39 -07:00
Derek Collison
08ca7b5f2a ServiceImports and queue groups
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 17:52:17 -08:00
Derek Collison
c5ee8b2cff Server sequences outbound may not appear sequential to other listening servers.
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 16:52:13 -08:00
Derek Collison
4bea6e0002 Test conditional fix
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 15:32:29 -08:00
Derek Collison
bdb42fab54 Don't erase nonce on reload
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 15:09:14 -08:00
Derek Collison
7b0f2426fa Internal clients aren't weighed against limits
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 14:23:59 -08:00
Derek Collison
ef5764eea0 Bump version, add RTT to StatsZ
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 11:46:14 -08:00
Derek Collison
18bca5603f Added server version and cluster name to statsz.
Fixed account connection accounting sending after local connections is 0.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 10:57:39 -08:00
Derek Collison
c3a658e1f1 Merge pull request #842 from nats-io/syslimit
Enforce account limits on system account too
2018-12-06 09:09:01 -08:00
Derek Collison
c0932df182 test update
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 09:02:47 -08:00
Ivan Kozlovic
6162f14dcc Merge pull request #840 from nats-io/gw_service_imports
Allow service import to work with Gateways
2018-12-06 09:59:03 -07:00
Derek Collison
b9aa2a3da4 Enforce account limits on system account too
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 08:37:22 -08:00
Ivan Kozlovic
a9b045498a Update based on comments
Do the swapping to outbound connection only on send.
It means that those subs are stored in the inbound connection and
those are the only type of subs stored there. So on connection close
it is easy to clean them up.
Also instead of having processMsgResults have to return this sub,
simply check the size of r.psubs and if 1, the type of client
associated with it. If gateway, we know we have to do the direct
send.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-06 09:32:39 -07:00
R.I.Pienaar
08eafd89f8 Expose the connection remote address to CustomClientAuthentication
This adds a RemoteAddress() method to the ClientAuthentication
interface which would facilitate CustomClientAuthentication
mechanisms considering the remote IP address of the client in
their decisions to allow clients or not

Resolves #832

Signed-off-by: R.I.Pienaar <rip@devco.net>
2018-12-06 09:04:56 +01:00
Ivan Kozlovic
111e050d32 Allow service import to work with Gateways
This is not complete solution and is a bit hacky but is a start
to be able to have service import work at least in some basic
cases.

Also fixed a bug where replySub would not be removed from
connection's list of subs after delivery.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-05 20:35:43 -07:00
Derek Collison
eb4a7156ca Hold Rlock on client remapping
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 16:21:20 -08:00
Derek Collison
f3f623565c fixes
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 16:00:30 -08:00
Derek Collison
a95fa1a8e9 race on global account
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 14:59:38 -08:00
Derek Collison
2d54fc3ee7 Account lookup failures, account and client limits, options reload.
Changed account lookup and validation failures to be more understandable by users.
Changed limits to be -1 for unlimited to match jwt pkg.

The limits changed exposed problems with options holding real objects causing issues with reload tests under race mode.
Longer term this code should be reworked such that options only hold config data, not real structs, etc.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 14:25:40 -08:00
Paulo Pires
67412b762c Support a path as argument to --signal
Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-12-05 16:46:48 +00:00
Ivan Kozlovic
afc3a45a37 Merge pull request #836 from nats-io/fix_misleading_tls_timeout_error
[FIXED] Misleading Slow Consumer error message during TLS Handshake
2018-12-04 21:22:01 -07:00
Ivan Kozlovic
5f493862e6 [FIXED] Misleading Slow Consumer error message during TLS Handshake
When a TLS timeout occurs, it was possible that code trying to
send data would get a timeout error and report it as a Slow Consumer
with the write deadline exceeded error.
Checking that if the connection is TLS and handshake not complete,
it is likely a TLS timeout error instead.

Resolves #835

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-04 20:23:12 -07:00
Ivan Kozlovic
4f8100ebc8 Fix config reload that failed because of Gateways
Although Gateways reload is not supported at the moment, I had
to add the trap in the switch statement because it would find
a difference. The reason is the TLSConfig object that is likely
to not pass the reflect.DeepEqual test. So for now, I exclude this
from the deep equal test and fail the reload only if the user
has explicitly changed the configuration.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-04 19:25:59 -07:00
Derek Collison
fa3df0c9af Allow accounts to be preloaded via config if using MemAccResolver.
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-04 14:23:19 -08:00
Derek Collison
53c70e6ce1 Use atomic.Load
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-04 09:09:27 -08:00
Derek Collison
f9912700c8 Rebase from master
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-04 08:48:40 -08:00
Derek Collison
760507222a Added statsz support
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-04 08:23:33 -08:00
Ivan Kozlovic
bb738ef8ce Merge pull request #830 from nats-io/sys_account_with_gateways
Allow system messages to cross gateways.
2018-12-04 09:02:11 -07:00
Ivan Kozlovic
2618d39a36 Allow system messages to cross gateways.
Removed the code getting matching subscriptions and trying
to exclude non internal interest since as soon as there is
routing and/or gateway, it is likely that server would end-up
generating the payload and sending. May need to revisit.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-03 20:59:32 -07:00
Ivan Kozlovic
0ba587249a Fixing setting of default gateway TLS Timeout
Moved setting to the default value in setBaselineOptions()
so that config reload does not fail.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-03 18:20:15 -07:00