Commit Graph

1529 Commits

Author SHA1 Message Date
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
ainsley
1559d1355a Add GOVERNANCE.md and rename OWNERS to MAINTAINERS.md and update roles
[ci skip]
2018-06-29 17:20:21 -05:00
ainsley
9993c0f4f1 Add GOVERNANCE.md and rename OWNERS to MAINTAINERS.md and update roles
[ci skip]
2018-06-29 16:40:26 -05:00
Derek Collison
1aa928a88d Merge pull request #699 from nats-io/badclient
Make sure closed connection accounting is correct for bad clients
2018-06-29 12:18:17 -07:00
Derek Collison
2e0830201c Make sure closed conn accounting correct for bad clients
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-29 11:42:23 -07:00
Derek Collison
b32c408c19 Merge pull request #698 from nats-io/echo
[ADDED] Ability to suppress echos from your own connection - Resolves #453
2018-06-29 10:51:46 -07:00
Derek Collison
a7dd092136 Add in proto to INFO
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-29 10:43:08 -07:00
Derek Collison
535367e340 Make sure sub registered, wait a bit for all msgs
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 18:45:46 -07:00
Derek Collison
061788ab9b Add no echo feature
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 18:34:27 -07:00
Derek Collison
e17ccb8760 Merge pull request #697 from nats-io/localhost
Allow localhost to not be defined, only need 127.0.0.1
2018-06-28 16:46:21 -07:00
Derek Collison
3b953ce838 Allow localhost to not be defined, only need 127.0.0.1
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 16:10:19 -07:00
Derek Collison
77af67543f Merge pull request #696 from nats-io/default
Fixes #686
2018-06-28 13:25:14 -07:00
Derek Collison
719deacc3d Fixes #686
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-28 13:14:18 -07:00
Ivan Kozlovic
a573a5da36 Merge pull request #694 from nats-io/fix_tests
Fix some tests
2018-06-27 18:14:36 -06:00
Ivan Kozlovic
aff1dcf089 Fix some tests
Add some helpers to check on some state.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-27 17:26:49 -06:00
Ivan Kozlovic
3b6386f36b Merge pull request #693 from nats-io/test_travis
Fix/tune some tests
2018-06-26 20:04:35 -06:00
Ivan Kozlovic
f692c0ef8a Add debug info for failed RTT test
The test TestConnzRTT() failed once with "invalid duration". Adding
the original string in case of error to understand better.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 19:54:12 -06:00
Ivan Kozlovic
cb1c2e7352 Use waitForClientConnCount() in TestConnzTLSInHandshake()
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 19:42:55 -06:00
Ivan Kozlovic
093ced686a Fix for TestClosedConnsAccounting() test
Add sleep to ensure closed connections are stored in expected
order since we later test on expected cid.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 19:31:04 -06:00
Ivan Kozlovic
c092c3d19e Wait for correct client count in TestConnzTLSInHandshake
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 18:52:56 -06:00
Ivan Kozlovic
0e422812cd Tune some more tests
- Increate WriteDeadline test that otherwise could cause a client
  connect to fail
- Check failed NumRoutes() with retry
- Check that subs are propagated in route permissions test

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 18:52:56 -06:00
Ivan Kozlovic
9259da2d3d Moved some tests to test files that compile only in no race mode
Some tests consume too much memory when running with -race which
can cause some failures on Travis.
Moreover, those tests may not be meaningful if they are running
slow, which -race causes.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 18:52:56 -06:00
Ivan Kozlovic
a759ad23aa Add back NoSigs=true to runServerWithSymlinkConfig()
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-06-26 18:52:56 -06:00
Derek Collison
63b0e63f15 Merge pull request #692 from nats-io/closed
Track closed connections and reason for closing
2018-06-26 17:32:45 -07:00
Derek Collison
81a1b02f0b Slightly higher so publisher can connect
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-26 17:01:51 -07:00
Derek Collison
57e57892da Test for closed state being correct
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-26 16:54:11 -07:00
Derek Collison
f9f478b143 Wait for all closed connections before starting
Signed-off-by: Derek Collison <derek@nats.io>
2018-06-26 15:14:32 -07:00