Commit Graph

236 Commits

Author SHA1 Message Date
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
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
6584a9a828 lint updates
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:41:38 -07:00
Derek Collison
acfe372d63 Changes for rename from gnatsd -> nats-server
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:04:24 -07:00
Derek Collison
5292ec1598 Various fixes, init smap for leafnodes with gateways too
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-02 14:22:51 -07:00
Derek Collison
2ec3eaeaa9 Leafnode account based connections limits
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-25 14:40:59 -07:00
Derek Collison
bfe83aff81 Make account lookup faster with sync.Map
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-23 17:13:23 -07:00
Derek Collison
bacb73a403 First pass at leaf nodes. Basic functionality working, including gateways.
What is not completed:
1. TLS
2. config to bind local account.
3. Info updates for solicitor to track topology changes like a client.
4. CONNECT sent after INFO for nonce authroization.
5. Authorization
6. Services and Streams tests.
7. config file parsing.

Signed-off-by: Derek Collison <derek@nats.io>
2019-03-25 08:54:47 -07:00
Derek Collison
c5510d616e Remove delay for global statsz, bump RC version
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-12 15:17:29 -08:00
Derek Collison
c385834f96 Some cleanup on outbound and flush
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-08 19:12:51 -08:00
Derek Collison
af78552549 Move ints to proper sizes for all
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-05 15:19:59 -08:00
Ivan Kozlovic
7449e9ac53 Replace megacheck with staticcheck
Fixed issues reported by staticcheck

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-01-09 14:14:47 -07:00
Derek Collison
cc5873cd72 Added start time to Statsz from server.
Added in more debug for imports processing.
Changed subs reporting for Statsz.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-19 13:19:00 -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
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
Derek Collison
c83d7f8851 Support server ping for statusz
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-07 08:42:01 -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
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
b9aa2a3da4 Enforce account limits on system account too
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-06 08:37:22 -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
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
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
Derek Collison
a2ec546850 Remove newest only
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-03 06:32:32 -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
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
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
Derek Collison
16e9bbaf4c Fixes for PR comments
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-29 12:54:07 -08:00
Derek Collison
574fd62e01 Allow servers to send and receive messages directly
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-29 12:15:08 -08:00