Commit Graph

984 Commits

Author SHA1 Message Date
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
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
Ivan Kozlovic
1011339375 Merge pull request #827 from nats-io/gw_send_all_subs
Switch to send-all-subs when number of RS- gets too big
2018-12-03 17:35:18 -07:00
Ivan Kozlovic
e7b6c5731e Update based on comments
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-03 17:17:55 -07:00
Derek Collison
b2d8421e21 Make tests a bit more stable
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-03 15:45:06 -08:00
Derek Collison
69d89f75e7 Merge pull request #825 from nats-io/operator
Updates for operator based configurations.
2018-12-03 14:19:23 -08:00
Derek Collison
e8aec2d712 PR comment fixes
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-03 14:13:07 -08:00
Ivan Kozlovic
a23ef5b740 Switch to send-all-subs when number of RS- gets too big
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-03 13:15:11 -07:00
Davor Kapsa
05f9a49f25 Fix ErrAuthentication comment 2018-12-03 19:25:45 +01:00
Derek Collison
a2ec546850 Remove newest only
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-03 06:32:32 -08:00
Derek Collison
4b6982dbcd Add timeout test for URL account resolver
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-03 05:40:34 -08:00
Derek Collison
f4f3d3baf1 Updates for operator based configurations.
Added update to parse and load operator JWTs.
Changed to add in signing keys from operator JWT to list of trusted keys.
Added URL account resolver.
Added account claim updates by system messages.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-02 20:34:33 -08:00
Derek Collison
222814609d Add in server shutdowns
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-01 17:30:22 -08:00
Derek Collison
46707a2c01 Return on bad number of tokens
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-01 16:53:23 -08:00
Derek Collison
4b1e5358bc Don't hold server lock when placing outbound items on sendq
Needed to change some things around but think this is close.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-01 16:48:57 -08:00
Derek Collison
744795ead5 Allow servers to send system events.
Specifically this is to support distributed tracking of number of account connections across clusters.
Gateways may not work yet based on attempts to only generate payloads when we know there is outside interest.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-01 13:54:25 -08:00
Ivan Kozlovic
dba4cfa791 Initialized the sublist for benchmark tests only when needed
This saves a lot of memory and init time when running non benchmark
tests in race mode.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-12-01 12:12:45 -07:00
Derek Collison
e2ce2c0cff Change to RawURLEncoding
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-29 17:04:58 -08:00
Derek Collison
2a19de7963 Merge pull request #819 from nats-io/sys
Allow servers to send and receive messages directly
2018-11-29 15:40:21 -08:00
Derek Collison
10eb491898 Better serializing of server info
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-29 15:22:04 -08:00
Derek Collison
4172e9b962 Serialize outbound messages
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-29 13:59:45 -08:00