Commit Graph

181 Commits

Author SHA1 Message Date
Ivan Kozlovic
c6d37ecf8f [IMPROVED] Route performance for larger messages 2016-08-01 19:01:34 -06:00
Ivan Kozlovic
61b0fec200 Updated test for corner cases
Test when client has not yet sent its CONNECT proto or the first
PING when route is added.
2016-07-26 11:57:16 -06:00
Ivan Kozlovic
fda5bd7ac7 [ADDED] Server sends INFO with cluster URLs to clients with support
Clients that will be at the ClientProtoInfo protocol level (or above)
will now receive an asynchronous INFO protocol when the server
they connect to adds a *new* route. This means that when the cluster
adds a new server, all clients in the cluster should now be notified
of this new addition.
2016-07-26 10:55:55 -06:00
Derek Collison
e3b5713ab9 Check for control line violations and memory attacks 2016-07-11 12:03:49 -07:00
Derek Collison
fa95bd936b spelling 2016-06-17 10:09:14 -07:00
Derek Collison
67ed61c837 fixups for PR comments 2016-06-17 09:59:39 -07:00
Derek Collison
248bd8d366 bug fix for _SYS. 2016-06-16 21:46:54 -07:00
Derek Collison
7730fac9e2 Authorization enforcement and performance tweaks 2016-06-16 17:07:25 -07:00
Derek Collison
27ac524daf version bump to next beta 2016-06-15 11:10:50 -07:00
Ivan Kozlovic
2bec28e146 Fix test
Loop should stop whenever a valid ip is found.
2016-05-23 20:05:09 -06:00
Derek Collison
82f04baa12 Allow optional reporting of authorized user under connz 2016-05-15 10:07:37 -07:00
Derek Collison
46a9e6f0bc First pass at multi-user support 2016-05-13 12:27:57 -07:00
Derek Collison
4c36522f55 new listen style 2016-05-12 17:22:09 -07:00
Derek Collison
9e73c1db76 Enable listen address parsing for client, cluster and http, enforce http hosts as separate 2016-05-12 16:47:01 -07:00
Colin Sullivan
8a07a02a97 Rename the field to 'total'. 2016-04-26 17:49:09 -06:00
Colin Sullivan
a6dfe88746 Add a live connection count to /connz monitoring. 2016-04-26 17:24:01 -06:00
Derek Collison
12fdd5dead Merge pull request #256 from nats-io/fix_data_race
Fix data race
2016-04-22 18:28:31 -07:00
Ivan Kozlovic
3691d14426 Fix missing capture of remoteID in removeClient
This needed to be captured under the client lock. Adding a test
that captured the races (when running enough times).
2016-04-22 18:06:38 -06:00
Ivan Kozlovic
ad1198db85 Add code coverage
-Test coverage was no longer triggered due to the check for BUILD_GOOS
 environment variable that was removed. Removed the check.
-Re-run test package with server code coverage.
-Remove unused functions in test.go.
-Add test for a function in test.go.
-Add missing parse +OK test.
2016-04-22 13:03:04 -06:00
Ivan Kozlovic
3a999c1299 Add tracking of most go routines started by the server
Refactor the way client is initialized. We need to ensure that
clients are not added to the clients map and readLoop started if
the server is in the process of being shutdown otherwise there
is a chance that the server already gathered the list of connections
to close and this one would not be included, leaving a readLoop
running.
Same occurs for routes, with the complexity that the readLoop is
started well before the route connection is added to the server
routes' list. We need a temporary map that contains those connections
to be able to close them on server Shutdown.

Fixed some flapping tests.
2016-04-21 11:48:39 -06:00
Derek Collison
4f333416bb Revert race on interest graph since it could cause dropped interest propogation, fix test instead 2016-04-15 15:46:29 -07:00
Derek Collison
3e2c3714bc Fix race in interest propogation to new routes 2016-04-15 13:16:13 -07:00
Derek Collison
433d62ec0a Parse IPs and raw strings in arrays properly 2016-04-07 08:36:57 -07:00
Derek Collison
21ec036da4 Add in vendor support 2016-04-05 10:52:40 -07:00
Derek Collison
768f23b5b4 dynamic read buffers 2016-04-03 14:30:17 -07:00
Derek Collison
96d9ce5048 Queue subscriber performance
Reworked sublist to sort out normal subscribers from queue subscribers into
a result set that can be cached and easily iterated over.
2016-04-03 13:04:06 -07:00
Derek Collison
a4c46694ff gosimple fixes 2016-03-31 07:33:36 -07:00
Ivan Kozlovic
76324844a9 Fixed handling of unprompted PONG protocols
- The number of outstanding PINGs is now reset whenever the server
receives a PONG from the client.
- Updated parser test to check c.pout.
- Added a test to check for unprompted PONGs.

Resolves issue: https://github.com/nats-io/gnatsd/issues/168
2016-03-23 14:30:44 -07:00
Derek Collison
3dd490a449 Go Report Card fixes 2016-03-20 16:06:28 -10:00
Colin Sullivan
2baac47820 Address issues found by golint.
* No functional changes
* Did not address the ALL_CAPS issues
* Did not modify public APIs and field names.
2016-03-15 15:21:13 -06:00
Ivan Kozlovic
6263c66a40 Fixed code and tests to run on Windows
Mainly tests, but also a fix in route.go to reject a route when the
server is being shutdown.
2016-03-07 18:47:20 -07:00
Derek Collison
d63b7eadcf spelling 2016-02-29 21:56:14 -08:00
Ivan Kozlovic
7c0a3b49a6 Fix cluster formation when servers connect quickly
Both seed and chained cases are now handled properly when servers
connect quickly and concurrently to one another.
When accepting a route, the server will forward the new route INFO
protocol to its known routes. In turn those routes will connect
to the new server (if not already connected).
A retry for implicit route was introduced to mitigate the issue
with two servers connecting to each other and electing the opposite
connection as the winner, resulting in both connections being dropped.
The server with smaller ID will try once to reconnect.
Some tests were fixed to handle possible extra INFO protocol.
New tests added.

Fix issue: https://github.com/nats-io/gnatsd/issues/206
2016-02-24 19:44:25 -07:00
Derek Collison
7237972420 support for bcrypt in cluster auth 2016-02-23 12:47:46 -08:00
Waldemar Quevedo
7ac3eae82e Set IP and Port for connections using TLS in /connz 2016-02-15 17:40:13 -08:00
Derek Collison
9fac37dd66 bad auth error test 2016-02-13 18:48:05 -08:00
Ivan Kozlovic
ce79f524be Fix scheme for routes returned
When server returns routes through INFO, use "nats-route://" scheme.
A test was checking that.
Add test to check that hostname is replaced with IP.
2016-02-11 17:20:33 -07:00
Ivan Kozlovic
112413a466 Fix infinite server attempt to connect route to itself
Attempt to address issue #175.
Instead of trying to detect if route URL will point to route listen address, detects that the route remoteID is server's ID.
If so, closes the connection and stop trying.
2016-02-10 14:19:54 -07:00
Ivan Kozlovic
b6292d6d6d Fix monitor port usage for parallel tests.
Use a different MONITOR_PORT for different test packages.
2016-02-08 09:33:39 -07:00
Derek Collison
1d5f4c3373 For possible slow travis tests 2016-02-06 07:41:37 -08:00
Derek Collison
a8f622269b For possible slow travis tests 2016-02-06 07:35:09 -08:00
Derek Collison
853b4d720b Randomize distribution to subscribers
Better performance for queue subscriber distribution.
2016-02-05 09:06:17 -08:00
Derek Collison
809f88a03a subs could be random 2016-02-05 08:32:11 -08:00
Derek Collison
907c226849 remove alloc tracking 2016-02-05 07:50:19 -08:00
Derek Collison
2fcdebc34d formatting 2016-02-05 07:36:48 -08:00
Derek Collison
661238eb1a Add 8 subscriber queue benchmark 2016-02-05 07:34:21 -08:00
Ivan Kozlovic
eb0eabff04 Replace all changes with simple 25ms delay after connection close. 2016-02-03 18:58:42 -07:00
Ivan Kozlovic
437458e13e Fix completeConnection + fix monitor test.
Don't check what is sent back. The point is that the client should be fully initialized at this point.
We can't ensure using metrics that the "check" connection is gone since in some tests, the server is started and clients auto-reconnect to it.
For tests that depend on the number of clients connected (such as the monitor one), have specific code for those tests.
2016-02-03 18:08:52 -07:00
Ivan Kozlovic
0a4da78f38 Fix code that checks that server is started + route test
- The raw connection used to check that the server is started now consumes the INFO and sends PING and consumes PONG before returning.
- The route test needs to make sure that the client connection has client id 2. Using PING/PONG before creating route connection to make sure of that.
2016-02-03 15:01:00 -07:00
Larry McQueary
7b5baa97d1 Corrected spelling of 'propagated' and 'propagation' 2016-02-02 12:22:49 -07:00