Commit Graph

2199 Commits

Author SHA1 Message Date
Ivan Kozlovic
2f48ad5150 Fixed subscription close
I noticed that TestNoRaceRoutedQueueAutoUnsubscribe started to
fail a lot on Travis. Running locally I could see a 45 to 50%
failures. After investigation I realized that the issue was that
we have wrongly re-used `subscription.nm` and set to -1 on unsubscribe
however, I believe that it was possible that when subscription was
closed, the server may have already picked that consumer for a delivery
which then causes nm==-1 to be bumped to 0, which was wrong.
Commenting out the subscription.close() that sets nm to -1, I could
not get the test to fail on macOS but would still get 7% failure on
Linux VM. Adding the check to see if sub is closed in deliverMsg()
completely erase the failures, even on Linux VM.

We could still use `nm` set to -1 but check on deliverMsg(), the
same way I use the closed int32 now.

Fixed some flappers.
Updated .travis.yml to failfast if one of the command in the
`script` fails. User `set -e` and `set +e` as recommended in
https://github.com/travis-ci/travis-ci/issues/1066

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-20 14:39:23 -06:00
Ivan Kozlovic
25e15d7162 Merge pull request #1100 from nats-io/remove_skip_email_notifications
Removing skipping email notification [ci skip]
2019-08-15 12:37:17 -06:00
Ivan Kozlovic
ef65ccbfd4 Removing skipping email notification [ci skip]
I had put that in place when testing the release process.
Removing now.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-15 11:00:34 -06:00
Ivan Kozlovic
c8ca58efb4 Merge pull request #1095 from nats-io/goreleaser
Prepare for v2.0.4 with goreleaser
v2.0.4
2019-08-15 10:02:32 -06:00
Ivan Kozlovic
a44e3f037c Change checksum file name to SHA256SUMS so it can be used with rget
See:
https://github.com/merklecounty/rget/blob/master/Documentation/integrations.md
6c02b98031/.goreleaser.yml (L30)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-15 09:07:20 -06:00
Ivan Kozlovic
e230e7fde9 Attempt at fixing flapper again
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-15 09:06:56 -06:00
Ivan Kozlovic
fc8087daa7 Updates based on comments
- add sha256 algo
- move some mem hungry tests while running with -race to the norace
- remove GOGC=10

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-15 09:06:56 -06:00
Ivan Kozlovic
07e3db6b8e Prepare for v2.0.4 with goreleaser
Also fixed some flappers

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-08-15 09:06:56 -06:00
Derek Collison
0fd42cffcb Merge pull request #1096 from nats-io/flap
Fix for flapping test
2019-08-15 07:50:41 -07:00
Derek Collison
2657092a04 Merge pull request #1098 from ethan-daocloud/patch-1
cleanup: fix word errors in errors.go
2019-08-15 07:36:26 -07:00
Guangming Wang
09954eee5c cleanup: fix word errors in errors.go
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-15 22:12:57 +08:00
Derek Collison
93313a149e Fix for flapping test
Signed-off-by: Derek Collison <derek@nats.io>
2019-08-14 23:52:49 -07:00
Derek Collison
c185a88146 Merge pull request #1094 from nats-io/cover
tmp disable of coveralls testing due to site down
2019-08-13 20:26:30 -07:00
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