Commit Graph

1979 Commits

Author SHA1 Message Date
Ivan Kozlovic
dce9d672c1 Fixed panic with leafnode and gateway when no interest registered
Say there are 2 clusters, A and B. A client connects to A and
publishes messages on an account that B has no interest in.
Then a leaf node server connects to B (using same account than
the no-interest is for). Cluster B will ask cluster
A to switch to interest mode only for leaf node account. This
would cause a panic.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-01 13:40:17 -06:00
Ivan Kozlovic
f04fb3775d Merge pull request #975 from nats-io/pre_release_rc8
Pre-Release 2.0.0-RC8
2019-05-01 12:18:16 -06:00
Ivan Kozlovic
de46bf5470 Pre-Release 2.0.0-RC8
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-05-01 11:37:48 -06:00
Ivan Kozlovic
8153ba048f Merge pull request #974 from nats-io/leaf-json-tag
Update JSON tag used for leaf node option
2019-04-30 13:23:16 -06:00
Waldemar Quevedo
984a59a6b0 Update json tag used for leaf node option 2019-04-30 12:09:44 -07:00
Derek Collison
1a6c9819f3 Added account export/import benchmark
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-26 12:03:00 -07:00
Derek Collison
0e5472a1cb Merge pull request #973 from nats-io/revert-891-include-parsing-fixes
Revert "Allow using quotes around include"
2019-04-26 11:41:35 -07:00
Waldemar Quevedo
ff357d8317 Revert "Allow using quotes around include" 2019-04-25 18:02:01 -07:00
Derek Collison
2d0abd66af Bump to RC7, remove conditional panic
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-25 17:09:53 -07:00
Derek Collison
e4a006dbfc Merge pull request #971 from nats-io/leaf_limits
Leafnode account based connections limits
2019-04-25 16:25:54 -07:00
Derek Collison
17839518de Updates based on PR feedback
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-25 15:47:35 -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
f5e574ce33 Merge pull request #968 from nats-io/account_map
Make account lookup faster with sync.Map
2019-04-23 19:34:24 -07:00
Derek Collison
26929d3e4b Fixed description
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-23 18:56:27 -07:00
Derek Collison
f320f318b7 Fixed merge conflict
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-23 17:28:42 -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
Ivan Kozlovic
ba7b621951 Merge pull request #965 from nats-io/gw_req_reply_v2
Gateways: Fix race for request reply
2019-04-23 17:30:18 -06:00
Ivan Kozlovic
9f497a6cd4 Revert to use Sublist but use the SublistNoCache version.
Remove sub from rsubs sublist when user UNSUBs.

Fix bench test that was not actually creating a SUB per request
in the Benchmark_Gateways_Requests_CreateOneSubForEach test.
Also UNSUBs older SUBs after a certain threshold to simulate
actual req/reply.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-23 14:13:13 -06:00
Ivan Kozlovic
41436fb787 Updates based on comments
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-22 20:00:21 -06:00
Ivan Kozlovic
bb4e8ae0f9 Gateways: Fix race for request reply
This addresses the following race:
- client connection creates a subscription on a reply subject
- client connection sends a request
- server sends the subscription to inbound gateway
- server sends the message to outbound gateway (those may be
  to different servers)
- receiving server sends to sub interested in request subject
- app sends reply
- its server then check for interest on the reply's subject

In interestOnly mode, there is a possibility that this server
has not received the interest on the reply subject yet and would
then drop the reply.

This PR detects above scenario and will prefix the reply subject
to identify the origin cluster if it is detected that the last
subscription from the sending connection was created less than
a second ago.
Once the destination has this prefix, the destination cluster
will always send back that message to origin cluster even if
there is no registered interest.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-22 20:00:21 -06:00
Derek Collison
2a7b2a9578 Merge pull request #967 from nats-io/nocache
Allow sublist cache to be disabled
2019-04-22 18:42:52 -07:00
Derek Collison
4ccfef004c Update for Ivan's suggestion on just checking s.cache since we have read lock
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-22 18:35:24 -07:00
Derek Collison
da2dab92d1 Allow disabling of shared cache with new constuctor. Also share empty results.
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-22 17:53:14 -07:00
Derek Collison
4ff42224c1 Merge pull request #966 from wallyqs/tls-auth-sans
Support SANs in TLS cert to define user permissions
2019-04-19 09:50:31 -07:00
Waldemar Quevedo
c3ee84a543 Support using SANs present in TLS cert for auth.
Also try multiple email and SANs found in cert until one valid
otherwise, default to the subject in the cert.

```
authorization {
  users [
    { user = "app.nats.dev", permissions = {
	publish {
	  allow = ["sandbox.>"]
	}
	subscribe {
	  allow = ["sandbox.>"]
	}
      }
    }
  ]
}
```

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-04-20 00:59:45 +09:00
Alberto Ricart
84a7e289b0 Added support for account signing keys. (#962)
* Added support for account signing keys. When account signing keys change
the validity of the client JWT and token imports need to be checked as well
as it is possible for the signing key used to sign the user or import
token to have been removed from the source account.
2019-04-18 19:08:26 -05:00
Ivan Kozlovic
bc11c1c284 Merge pull request #963 from nats-io/start_go_routine_lead_node
Fixed invocations of startGoRoutine (continued)
2019-04-18 11:23:31 -06:00
Ivan Kozlovic
ac49f715c4 Fixed invocations of startGoRoutine (continued)
The leafnode start of go routines for readloop and writeloop were
missing from PR #961

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-18 10:31:23 -06:00
Ivan Kozlovic
f17c5142dd Merge pull request #961 from nats-io/fix_start_go_routine_calls
Fixed invocations of startGoRoutine
2019-04-18 09:59:39 -06:00
Ivan Kozlovic
bf07862140 Fixed invocations of startGoRoutine
Resolves #960

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-18 09:51:56 -06:00
Derek Collison
b1d0ec10c6 Merge pull request #959 from nats-io/add_leafnode_test
Test for leafnodes, service imports and clusters
2019-04-17 15:13:15 -07:00
Ivan Kozlovic
fbf84aca9b Merge pull request #958 from nats-io/reduce_gw_init_mem
Reduce startup memory for gateways
2019-04-17 15:38:32 -06:00
Derek Collison
bfef3bd5a6 Fix for service import processing across routes for leaf nodes
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-17 14:37:09 -07:00
Ivan Kozlovic
d8098c134b Reduce startup memory for gateways
Similar to #956 but for gateways code.
Also fixing route test TestLargeClusterMem.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-17 15:18:46 -06:00
Ivan Kozlovic
8f35c6451f Merge pull request #957 from nats-io/fix_955
Fixed panic when server needs to send message to more than 8 routes
2019-04-17 13:40:46 -06:00
Ivan Kozlovic
288f00ff81 Fixed panic when server needs to send message to more than 8 routes
Resolves #955

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-17 13:02:41 -06:00
Derek Collison
0c8bf0ee8b Merge pull request #956 from nats-io/mem
Reduce startup memory for cluster
2019-04-17 11:21:50 -07:00
Derek Collison
f1d06d6c5b Reduce startup memory for cluster
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-17 11:05:29 -07:00
Ivan Kozlovic
bda267ec2c Add LeafNode import/export test with routes
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-16 19:26:28 -06:00
Derek Collison
a4af582dfb Merge pull request #949 from nats-io/gw_doc
Gateways: adding documentation in README [ci skip]
2019-04-15 16:56:37 -05:00
Ivan Kozlovic
756414d833 Gateways: adding documentation in README [ci skip]
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-15 15:39:59 -06:00
Derek Collison
e2ee8127e6 Merge pull request #948 from nats-io/fix_readme_typo
[FIXED] small typo in README [ci skip]
2019-04-15 12:30:10 -05:00
Ivan Kozlovic
6eb06ea7b3 [FIXED] small typo in README [ci skip]
Resolves #947

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-15 11:24:04 -06:00
Ivan Kozlovic
1777e2d1e2 Merge pull request #943 from nats-io/add_tlsconfig_server_name_test
Added test gateway tlsConfig.ServerName
2019-04-15 11:22:09 -06:00
Ivan Kozlovic
4ea96337ed Added test gateway tlsConfig.ServerName
Checks that if not provided server fails to connect to remote
gateway. Once set to expected hostname ("localhost"), connection
works.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-12 11:21:57 -06:00
Ivan Kozlovic
172eca6110 Merge pull request #922 from danielsdeleo/dan/allow-explicit-server-name-in-gateway
Allow explicit server name in tls.Config
2019-04-12 11:20:55 -06:00
Derek Collison
a67fd1bc1a Merge pull request #938 from nats-io/gomod
Update to gomod with vendor directory, update vendored pkgs
2019-04-09 18:04:02 -07:00
Derek Collison
0f98b1506f Update to gomod with vendor directory, update vendored pkgs
Signed-off-by: Derek Collison <derek@nats.io>
2019-04-09 17:41:57 -07:00
Ivan Kozlovic
064b3441cc Merge pull request #937 from nats-io/add_warning_if_cluster_insecure
Add a warning if cluster's insecure setting is enabled
2019-04-09 18:18:31 -06:00
Ivan Kozlovic
4dd1b26cc5 Add a warning if cluster's insecure setting is enabled
For cluster, we allow to skip hostname verification from certificate.
We now print a warning when this option is enabled, both on startup
or if the property is enabled on config reload.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-04-09 17:37:53 -06:00