Commit Graph

2186 Commits

Author SHA1 Message Date
Derek Collison
1fc7e99e76 tmp disable of coveralls testing due to site down
Signed-off-by: Derek Collison <derek@nats.io>
2019-08-13 20:16:18 -07:00
Derek Collison
e76f66c1cd Merge pull request #1093 from wallyqs/typo
Fix typo
2019-08-13 20:05:08 -07:00
Waldemar Quevedo
5c776d4363 Fix typo
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-08-13 19:59:28 -07:00
Ivan Kozlovic
a11524c543 Merge pull request #1092 from nats-io/fix_duplicate_conn_close
[FIXED] Connection could be closed twice
2019-08-13 20:36:22 -06:00
Ivan Kozlovic
c20afd4016 [FIXED] Connection could be closed twice
This was introduced in PR#930. The first commit had the route's
check if the flushOutbound() returned false, and if so would
locally unlock/lock the connection's lock. Unfortunately, this
was replaced in the second commit (a6aeed3a6b)
to the flushOutbound() function itself.
This causes the function closeConnection() to possibly unlock
the connection while calling flushOutbound(), which if the
connection is closed due to both a tls timeout for instance
and explicitly, it would result in the connection being scheduled
for a reconnect (if explicit gateway connection, possibly route).

Added defensive code in Gateway to register a unique outbound gateway.

Fixed a test that was now failing with newer Go version in which
they fixed url.Parse()

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-13 20:11:03 -06:00
Derek Collison
5620300074 Merge pull request #1091 from nats-io/jwt_response_type
Added support for service response types
2019-08-12 09:03:20 -06:00
Stephen Asbury
4d63709852 Added support for service response types
Test checks that response types are initialized
Updated to latest JWT library with response types
Updated jwt in vendor
2019-08-09 17:54:17 -07:00
Derek Collison
49ab0dfbb7 Merge pull request #1090 from nats-io/streams
Add ability for cross account import services to return streams
2019-08-06 19:40:47 -07:00
Derek Collison
2fad14a915 Add in copy of respMap on reload
Signed-off-by: Derek Collison <derek@nats.io>
2019-08-06 18:43:06 -07:00
Derek Collison
35c96713a0 fixes based on feedback
Signed-off-by: Derek Collison <derek@nats.io>
2019-08-06 15:55:33 -07:00
Derek Collison
8f5bc503e5 Add ability for cross account import services to return streams as well as singeltons.
Take into account tracking of response maps that are created and do proper cleanup.
Also fixes #1089 which was discovered while working on this.

Signed-off-by: Derek Collison <derek@nats.io>
2019-08-06 14:15:40 -07:00
Derek Collison
5252099ff6 Bump version [ci skip]
Signed-off-by: Derek Collison <derek@nats.io>
2019-08-01 15:44:39 -07:00
Ivan Kozlovic
f5a6c0d476 Merge pull request #1087 from nats-io/reduce_memuse_routing
[FIXED] Reduce memory usage on routes
2019-07-29 21:00:30 -06:00
Ivan Kozlovic
b537f130cc Use goto to remove entry from cache
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-29 20:52:57 -06:00
Ivan Kozlovic
6fd6ac2821 Update based on comments
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-29 20:38:22 -06:00
Derek Collison
5d9ca4a919 Merge pull request #1088 from nats-io/leafnode
Add leafnode connections to varz
2019-07-29 22:30:01 -04:00
Derek Collison
ea33b1093b Add leafnode connections to varz
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-29 21:43:30 -04:00
Ivan Kozlovic
887e744d07 [FIXED] Reduce memory usage on routes
When a route receives a message, it uses a thread local cache to
find the account and subscriptions match for a given subject.
When not found, an entry is added to this cache. The problem is
that this cache will reference subscriptions that in turn
reference connections.
When the subscriptions/connections are closed, this thread local
cannot be purged from those closed subscriptions (since it is
thread local - no lockin is used).
The real issue is that connection's buffer was not set to nil on
close, which then could cause more than expected memory to be
still referenced. Setting the buffer to nil will help reduce the
memory being used.
When an entry is added to the cache, the cache may reach a size
that will cause the server to prune some entries. From time to
time, the cache will be scanned to look for entries that contain
only closed subscriptions and remove those.

Resolves #1082

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-29 17:54:21 -06:00
Derek Collison
3113b93d57 Merge pull request #1086 from nats-io/revoke
Added support for user and activation token revocation
2019-07-29 13:35:58 -04:00
Derek Collison
507432648b flapper
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-28 07:10:37 -07:00
Derek Collison
5bec08ac6a Added support for user and activation token revocation
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-28 06:49:39 -07:00
Derek Collison
e5f421ef95 Merge pull request #1085 from nats-io/reponse
Add in user JWT support for ResponsePermissions
2019-07-26 16:21:49 -07:00
Derek Collison
bf902d9e7c Add in user JWT support for ResponsePermissions
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-26 16:15:13 -07:00
Derek Collison
34ff5aade6 Merge pull request #1084 from nats-io/rcheck
Check response perms more often, make sure we limit memory growth
2019-07-25 17:07:40 -07:00
Derek Collison
8bfe14bbfd check response perms more often, make sure we limit memory growth
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-25 16:53:54 -07:00
Derek Collison
e969b18feb Merge pull request #1081 from nats-io/perms
Allow dynamic publish permissions based on reply subjects of received msgs.
2019-07-25 13:38:00 -07:00
Derek Collison
495a1a7ec3 Allow dynamic publish permissions based on reply subjects of received msgs
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-25 13:17:26 -07:00
Derek Collison
9cf534bc5e Merge pull request #1079 from nats-io/leaksubs
Fix for #1065 (leaked subscribers from dq subs across routes)
2019-07-23 08:32:25 -07:00
Derek Collison
df29be11ed Changes based on PR comments
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-22 18:37:40 -07:00
Derek Collison
1d6c58074f Fix for #1065 (leaked subscribers from dq subs across routes)
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-22 17:17:43 -07:00
Derek Collison
d749954b7f Merge pull request #1078 from nats-io/fix-leaf-user-signer
leafnode user jwt with signer fails to authenticate on solicit
2019-07-17 16:15:33 -07:00
Alberto Ricart
273e5af0a8 Fixed an issue where the leaf authentication was not checking for account/signers, so user JWTs signed by a signer failed authentication. 2019-07-17 16:03:55 -04:00
Ivan Kozlovic
6a40503f97 Merge pull request #1077 from nats-io/release_2_0_2
Release 2.0.2
v2.0.2
2019-07-15 10:24:18 -06:00
Ivan Kozlovic
b61744aa17 Release 2.0.2
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-15 09:49:00 -06:00
Derek Collison
965f8fe8b2 Merge pull request #1076 from andyxning/add_ut_for_tracemsg
add ut for tracemsg
2019-07-15 08:26:46 -07:00
Andy Xie
2f99b144aa add ut for tracemsg 2019-07-15 14:02:02 +08:00
Derek Collison
7a3fb4ebe0 Merge pull request #1057 from andyxning/allow_limits_to_traced_message
allow limit to traced message
2019-07-14 21:34:31 -07:00
Andy Xie
cd214fca89 allow limit to traced message 2019-07-15 11:39:00 +08:00
Derek Collison
0e4e5c648b Merge pull request #1075 from nats-io/parse
If we read data and have an error, still process and parse data.
2019-07-13 09:25:07 -07:00
Derek Collison
8262082289 If we read data and have an error, still process and parse data.
This is helpful for clients who send data and close the connection.
Also helpful to process errors like auth for solicited leafnodes.

Signed-off-by: Derek Collison <derek@nats.io>
2019-07-13 05:19:35 -07:00
Ivan Kozlovic
253263cfac Merge pull request #1074 from nats-io/fix_ln_urls_in_info
[FIXED] LeafNode urls may be missing in INFO sent to LN connections
2019-07-12 19:31:23 -06:00
Ivan Kozlovic
0873b46f67 [FIXED] LeafNode urls may be missing in INFO sent to LN connections
When a cluster of servers are having routes to each other, there
is a chance that the list of leafnode URLs maintained on each
server is not complete. This would result in LN servers connecting
to this cluster to not get the full list of possible URLs the
server could reconnect to.

Also fixed a DATA RACE that appeared when running the updated
TestLeafNodeInfoURLs test. Fixed the race and added specific
test that easily demonstrated the race: TestLeafNodeNoRaceGeneratingNonce

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-12 19:15:30 -06:00
Ivan Kozlovic
8d46d37d58 Merge pull request #1073 from nats-io/add_warn_for_leafnode_tls_insecure
Add warning for TLS insecure setting on LeafNodes
2019-07-12 18:08:32 -06:00
Ivan Kozlovic
0a72993d80 Add warning for TLS insecure setting on LeafNodes
Also fix for #1071 in that we need to check remote gateways TLS
config even if main gateway section is not configured with TLS.

Related to #1071

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-12 17:22:57 -06:00
Derek Collison
7766f27616 Bump version to RC2 [ci skip]
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-12 14:29:07 -07:00
Derek Collison
18a2c357e4 Merge pull request #1072 from nats-io/handshake
Report authorization error and use TLS hostname for IPs on leafnodes.
2019-07-12 14:11:53 -07:00
Derek Collison
a795920dc3 Report authorization error and use TLS hostname for IPs on leafnodes.
Signed-off-by: Derek Collison <derek@nats.io>
2019-07-12 13:57:16 -07:00
Ivan Kozlovic
8458a093de Merge pull request #1071 from nats-io/support_insecure_skip_verify
[FIXED] Allow TLS InsecureSkipVerify again
2019-07-12 14:29:21 -06:00
Ivan Kozlovic
9e09486e26 Use all caps for the production message
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-12 13:44:01 -06:00
Ivan Kozlovic
37d08a6c56 [FIXED] Allow TLS InsecureSkipVerify again
This has an effect only on connections created by the server,
so routes and gateways (explicit and implicit).
Make sure that an explicit warning is printed if the insecure
property is set, but otherwise allow it.

Resolves #1062

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-12 12:10:28 -06:00