Commit Graph

140 Commits

Author SHA1 Message Date
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
Derek Collison
25732e087b New client TLS handling 2016-01-16 17:46:04 -08:00
Derek Collison
e9b5839bf0 Merge branch 'discovery' 2015-12-16 14:18:34 -08:00
Derek Collison
8393c3c994 Basic INFO for cluster auto-discovery, Addresses #126 2015-12-16 12:36:24 -08:00
Ivan Kozlovic
d133e68338 Adapt tests for Travis GCE.
* Add server.GetListenEndpoint() to return options' host and port when server is ready to accept client connections. The server can be asked to pick a random port. This function returns a string of the form "host:port" with the port selected by the net.Listen() call.
* Replace the use of server.Addr() with above function to connect to the starting server (using net.Dial) to check for success. The original issue was that, when no hostname is specified in the configuration, the server uses 0.0.0.0 for the listen address. However, server.Addr() would return "[::]", even on a machine with IPv6 disabled, which would cause the net.Dial call to fail with "network unreachable".
2015-12-10 13:06:18 -07:00
Ivan Kozlovic
9b25a379b8 Increase TLS timeout in config files
We would get failures on Travis, I would think because of small TLS timeout. Increase (or set) the TLS timeout to 2 seconds in most configuration files. Update tests that relied on the original value.
2015-12-08 15:20:20 -07:00
Ivan Kozlovic
d2a21daf53 Merge pull request #159 from nats-io/fix_test
Fix test that was failing on Windows.
2015-12-08 14:25:55 -07:00
Ivan Kozlovic
964c277c63 Create the reconnectsDone channel big enough to prevent blocking on reconnect. Remove the explicit closing of clients, we should not have to do that. It still hangs on a windows VM though. 2015-12-08 13:56:40 -07:00
Ivan Kozlovic
a0cdd30bd9 Fix test that was failing on Windows.
* There was a bug in the send loop (use of 1 instead of i)
* On Windows specifically, the test did not exit without explicit closing of the connections (I don't think we should have to do that). This behavior combined with the send loop bug would cause this test to consume all memory on the machine.
2015-12-08 09:43:50 -07:00
Ivan Kozlovic
5036bbbf36 Fix TLS issue where server started to receive TLS data on non TLS connection.
Without the server fix, tls_test.go would likely report an error. The server would show a parser error with protocol snippet containing "random" bytes, likely encrypted data.
2015-12-07 19:44:12 -07:00
Ivan Kozlovic
b07f3fef92 Add 'net' on more config files for Travis' new GCE platform. 2015-12-07 19:26:40 -07:00
Derek Collison
f04e44fad7 Allow more time for goroutines to exit 2015-11-30 19:51:40 -08:00
Derek Collison
34eeadfb76 Should be QSRIDs 2015-11-30 19:47:16 -08:00
Derek Collison
6b8e8d89c8 Use smaller cost function for test, fix race 2015-11-30 18:29:53 -08:00
Derek Collison
6fc9927f52 bcrypt support for passwords and tokens 2015-11-30 17:38:08 -08:00
Waldemar Quevedo
18f932620f Avoid cap out of range error when handling split buffer 2015-11-29 11:11:17 -08:00
Derek Collison
2a8293a11d Move defer closer 2015-11-22 16:31:16 -08:00
Derek Collison
1a2dab0494 Run TLS pub/sub under complex example 2015-11-22 16:22:27 -08:00
Derek Collison
8ff37c03ec Allow EOF as well 2015-11-22 16:17:29 -08:00
Derek Collison
647213b1d7 TLS timeout handling for routes 2015-11-22 15:07:44 -08:00
Derek Collison
3b64567f00 tls flags, proper timeouts 2015-11-22 14:43:16 -08:00
Ivan Kozlovic
97da466312 Fix races, add a test and adjust others.
* There was a race during unsubscribe()
* 'go test -race' reports a race in TestSetLogger test. This one could be ignored since we normally invoke SetLogger only on server startup. That being said, Travis failed when I tried to submit a PR for the fix of the unsubscribe race. So proposing to fix the logger too.
2015-11-18 20:39:56 -07:00
Ivan Kozlovic
17d231361d Fix handling of duplicate SUB protocol.
This is issue #136. With routes, it is possible that a subscriber connects (or reconnects) and is about to broadcast the SUB protocol to the routed server, and at the same time, the server sends the list of the local subscriptions. This would result in a SUB processed twice, adding the same sub in the sublist twice. If the server sending the subscription list is restarted, this will leave "detached" subscriptions in the sublist which would trigger the "Bad or Missing ROUTER info" for every message published on that subject.
2015-11-17 20:58:54 -07:00
Derek Collison
688f2a9f64 Give some time for TLS setup 2015-11-08 14:28:43 -08:00
Derek Collison
b8af53e67a Added in clustered TLS 2015-11-08 14:20:01 -08:00
Derek Collison
416cf99068 larger buffer needed for info message 2015-11-08 11:11:03 -08:00
Derek Collison
ec0c658344 Adding in client cert/key pair 2015-11-08 10:58:40 -08:00
Derek Collison
1c7f708217 Added in support for requiring client certificates 2015-11-08 10:48:39 -08:00
Derek Collison
a7b74468dd more cleanup 2015-11-05 18:09:07 -08:00
Derek Collison
5004efe54b new files for TLS 2015-10-22 03:32:11 +02:00
Derek Collison
749d4f89cc First pass at client TLS support 2015-10-22 03:30:27 +02:00
Derek Collison
fe3b8f2aa1 BufSize option, bump for go1.5.1, bump version 2015-09-18 07:41:33 -07:00
Derek Collison
45564dbde2 race fixes, go1.5 on travis 2015-09-17 19:02:00 -07:00
Waldemar Quevedo
093548c072 Update max payload test to reflect behavior change in go client.
Adds logic to test which mimics previous behavior of client.
2015-09-09 21:09:14 -07:00
Derek Collison
47994eaf2c Track performance 2015-08-23 12:51:52 -07:00
Derek Collison
cb47c2e494 fixup for collapsed struct 2015-08-06 01:01:29 -07:00
Derek Collison
075529e2fe Properly handle and enforce max payload 2015-08-05 22:05:58 -07:00
Derek Collison
96acffdc35 Updated copyright, removed commented imports 2015-07-14 10:57:57 -07:00
Derek Collison
90d1d6d572 Much improved large message performance 2015-06-25 13:51:53 -07:00
Derek Collison
96bab33075 fixed import paths 2015-06-19 12:08:11 -07:00
Derek Collison
d9c7392c4d race fixes, tests 2015-06-16 12:48:50 -07:00
Derek Collison
082a43f7ae Additional testing for monitoring 2015-06-16 10:31:15 -07:00