Commit Graph

1555 Commits

Author SHA1 Message Date
Ivan Kozlovic
b79d618bf7 Prepare for new release
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-29 13:07:39 -06:00
Derek Collison
803ca55e87 Merge pull request #729 from nats-io/sublist_race
Avoid a race between sublist and cache on store
2018-08-29 11:48:43 -06:00
Derek Collison
5b7cabd25e Avoid race between sublist and cache on store-s 2018-08-29 11:34:55 -06:00
Ivan Kozlovic
9333f9ff0f Make listen port random in test added in previous PR
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-27 19:27:52 -06:00
Ivan Kozlovic
1cdf39d7f4 Merge pull request #727 from nats-io/fix_route_permissions
Fixed crash related to route permissions after allow/deny feature
2018-08-27 19:16:35 -06:00
Ivan Kozlovic
7324271098 Merge pull request #728 from nats-io/fix_sublist_cache_flapper
Fix sublist cache flapping test
2018-08-27 19:05:57 -06:00
Ivan Kozlovic
156224a85b Fix sublist cache flapping test
Use `checkFor` to ensure that cache size is ok. Repeated test
1000 times and no failure now.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-27 15:01:38 -06:00
Ivan Kozlovic
7e39d0935d Fixed crash related to route permissions after allow/deny feature
This is an issue in master only, not in any public release.
The issue is that permissions should be assigned as-is for the
route perms because Publish/Subscribe could be nil, so trying
to dereference Publish.Allow/Deny or Subscribe.Allow/Deny could
crash. The code checking for permissions correctly check if
Publish/Subscribe is nil or not.

This was introduced with PR #725

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-27 14:43:32 -06:00
Derek Collison
c926b56d1f Merge pull request #726 from nats-io/sublist_cache
Sublist Shared Cache Improvements
2018-08-27 12:03:49 -07:00
Derek Collison
2c4b7e7d54 Let cache sweeper run
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-27 12:56:28 -06:00
Derek Collison
ad3a1506d3 Move test into cache test, make sure it fails
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-27 12:49:29 -06:00
Derek Collison
ab9e4c7d8a Fix for wildcard cache addition
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-27 12:28:32 -06:00
Derek Collison
d21ac8de35 Use sync.Map for cache, fast version of literal test
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-25 17:42:36 -07:00
Derek Collison
543d403337 Optimize sublist cache, add tests for cache contention
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-25 14:33:15 -07:00
Derek Collison
34b556dd9f Additional nil checks for perms
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-25 09:49:29 -07:00
Derek Collison
976e7548a9 Merge pull request #725 from nats-io/deny
Deny/Allow Permissions
2018-08-23 17:09:38 -07:00
Derek Collison
7b9bab22c9 Reduce duplicate code, check subjects
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-23 16:47:20 -07:00
Derek Collison
27d754991e newline
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-23 16:42:26 -07:00
Derek Collison
3798df3044 Undo tmp changes not meant for PR
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-23 16:41:55 -07:00
Derek Collison
f5375e682b Test cache too 2018-08-23 16:34:25 -07:00
Derek Collison
5955f22d65 Add in route permission support
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-23 14:42:43 -07:00
Derek Collison
a79806e79d Add enforcement of allow and deny permissions
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-23 11:00:35 -07:00
Derek Collison
65188f9768 Added parser for new style authorizations
Signed-off-by: Derek Collison <derek@nats.io>
2018-08-22 20:41:48 -07:00
Ivan Kozlovic
3ad63c7cb6 Merge pull request #722 from nats-io/changes_for_service_and_syslog
Update service and syslog code to use variable instead of constant
2018-08-16 11:47:12 -06:00
Ivan Kozlovic
8b723c4287 Merge pull request #721 from nats-io/fix_url_comparison
Ensure URLs are compared using reflect.DeepEqual
2018-08-16 11:41:14 -06:00
Ivan Kozlovic
2153a45050 Update service and syslog code to use variable instead of constant
for the process name and service name. This allows the reuse of this
code in NATS Streaming Server by invoking the new setters to
change the service and process names.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-16 10:21:01 -06:00
Ivan Kozlovic
b1bb181f3d Ensure URLs are compared using reflect.DeepEqual
I don't think it is a good thing to compare the pointers and we
should use the DeepEqual instead.
When comparing a solicited route's URL to the URL that was created
during the parsing of the configuration, the pointers maybe the
same and so u1 == u2 would work. However, there are cases where
the URL is built on the fly based on the received route INFO protocol
so I think it is safer to use a function that does a reflect.DeepEqual
instead.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-16 09:48:32 -06:00
Derek Collison
a2b5acfd3d Merge pull request #720 from nats-io/fix_reload_cluster_auth
[FIXED] Possible cluster `Authorization Error` during config reload
2018-08-15 22:44:59 -07:00
Ivan Kozlovic
d98d51c8cc [FIXED] Possible cluster Authorization Error during config reload
When changing something in the cluster, such as Timeout and doing
a config reload, the route could be closed with an `Authorization
Error` report. Moreover, the route would not try to reconnect,
even if specified as an explicit route.

There were 2 issues:
- When checking if a solicited route is still valid, we need to
  check the Routes' URL against the URL that we try to connect
  to but not compare the pointers, but either do a reflect
  deep equal, or compare their String representation (this is
  what I do in the PR).
- We should check route authorization only if this is an accepted
  route, not an explicit one. The reason is that we a server
  explicitly connect to another server, it does not get the remote
  server's username and password. So the check would always fail.

Note: It is possible that a config reload even without any change
in the cluster triggers the code checking if routes are properly
authorized, and that happens if there is TLS specified. When
the reload code checks if config has changed, the TLSConfig
between the old and new seem to indicate a change, eventhough there
is apparently none. Another reload does not detect a change. I
suspect some internal state in TLSConfig that causes the
reflect.DeepEqual() to report a difference.

Note2: This commit also contains fixes to regex that staticcheck
would otherwise complain about (they did not have any special
character), and I have removed printing the usage on startup when
getting an error. The usage is still correctly printed if passing
a parameter that is unknown.

Resolves #719

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-15 18:20:29 -06:00
Ivan Kozlovic
6608e9ac3b Merge pull request #709 from nats-io/release_1_2_0
Prepare for release 1.2.0
v1.2.0
2018-07-05 10:41:09 -06:00
Ivan Kozlovic
cd28d58a90 Prepare for release 1.2.0
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-07-05 10:12:06 -06:00
Ivan Kozlovic
508240ba8b Merge pull request #708 from nats-io/flaky
Fix for flaky tests
2018-07-03 11:31:23 -06:00
Derek Collison
1c832bb787 Still need to wait a bit for propogation
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-03 08:53:26 -07:00
Ivan Kozlovic
895f05e5e9 Merge pull request #691 from nats-io/port-file
Added Internal option to write a ports file `--ports_file_dir`
2018-07-02 18:03:47 -06:00
Derek Collison
f7241aa435 Allow max and max/2 for edge conditions
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-02 14:29:29 -07:00
Alberto Ricart
247552600f Merge branch 'port-file' of github.com:nats-io/gnatsd into port-file 2018-07-02 15:52:57 -05:00
Alberto Ricart
456c09855e fmt 2018-07-02 15:50:03 -05:00
Derek Collison
85c2edc314 Make sure to flush the sub
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-02 12:10:17 -07:00
Derek Collison
90a3a1d8b4 Slow down sweeper to make sure we receive all messages
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-02 12:02:59 -07:00
Derek Collison
bd972a9aca fixes
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-02 11:46:40 -07:00
Derek Collison
2b58a12123 Merge pull request #707 from nats-io/subs
Subscription debugging/monitoring
2018-07-02 11:01:07 -07:00
Derek Collison
3a4a1a060c Changes from comments on PR
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-02 10:35:18 -07:00
Derek Collison
e78d587083 Added support for maximum subscriptions per connection
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-01 15:13:59 -07:00
Derek Collison
305d7bdf88 Allow subsz detail and test for matching subs
Signed-off-by: Derek Collison <derek@nats.io>
2018-07-01 13:02:28 -07:00
Alberto Ricart
ef09fd284c Merge branch 'master' into port-file 2018-06-30 14:10:28 -05:00
Derek Collison
d30afb229f Remove insecure flag, cert fixed [ci skip]
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-30 07:15:38 -07:00
Derek Collison
43b991443f Merge pull request #705 from nats-io/sort
Added more sort options, fixed some broken ones.
2018-06-29 18:08:09 -07:00
Derek Collison
cd834a36fa Added more sort options, fixed some broken ones.
Fixes #700, #701, #702

Signed-off-by: Derek Collison <derek@nats.io>
2018-06-29 17:44:01 -07:00
Derek Collison
60bd35f552 Merge pull request #703 from nats-io/add-governance-maintainers
Add Governance / Maintainers
2018-06-29 15:25:58 -07:00
ainsley
8c146b8676 Add GOVERNANCE.md and rename OWNERS to MAINTAINERS.md and update roles
[ci skip]
2018-06-29 17:24:25 -05:00