Commit Graph

726 Commits

Author SHA1 Message Date
Derek Collison
fc3e345eb2 gosimple fixes 2016-03-31 07:34:13 -07:00
Derek Collison
a4c46694ff gosimple fixes 2016-03-31 07:33:36 -07:00
Derek Collison
f23f55518c gosimple fixes 2016-03-31 07:28:40 -07:00
Derek Collison
4b9bb4b9b3 Added _SYS events 2016-03-30 11:27:22 -07:00
Derek Collison
3a6e5ce5a6 Merge pull request #229 from nats-io/fix_pong
Fixed handling of unprompted PONG protocols
2016-03-23 15:11:29 -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
Derek Collison
50a14ac1d5 Modified debug and server id 2016-03-20 15:57:43 -10:00
Derek Collison
efce5d568e Merge pull request #224 from nats-io/fix-lint-issues
Address issues found by golint.
2016-03-15 14:52:09 -07: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
Derek Collison
ebe6bcdbd3 Merge pull request #222 from nats-io/fixes_for_windows
Fixed code and tests to run on Windows
2016-03-08 08:00:26 +02: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
adb2a059b5 Additional tests for next generation design 2016-03-07 22:51:51 +02:00
Derek Collison
0a02aab703 simplify and test for non-optimization 2016-03-07 06:58:48 +00:00
Derek Collison
d09b6bdcf7 Optimize last activity and revert queue performance to alleviate normal sub performance hit 2016-03-07 06:24:23 +00:00
Derek Collison
49a7f2295a gofmt -s fixes 2016-02-29 22:08:49 -08:00
Derek Collison
d63b7eadcf spelling 2016-02-29 21:56:14 -08:00
Derek Collison
7a13d68bd3 Merge pull request #215 from nats-io/fix_route_discovery
Fix cluster formation when servers connect quickly
2016-02-29 10:58:27 -08:00
Ivan Kozlovic
3ea412798a Optimizations
-No need to store ip url string in c.route and resolve remote IP
 when forwarding the INFO to known servers.
-When checking if a route is explicit, use strings.ToLower() once
 for the url being checked.
2016-02-25 20:00:21 -07: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
7a7cbfa80b Merge pull request #214 from nats-io/nuid
nuid
2016-02-24 10:33:14 -08:00
Derek Collison
b34d6eac1e ID prefix, print debug server ID on startup, bumped version 2016-02-24 09:38:28 -08:00
Derek Collison
8e5f925b87 Bumped version for nuid 2016-02-24 09:23:10 -08:00
Derek Collison
81ae341c2c Use nuid for ID generation 2016-02-24 09:22:38 -08:00
Derek Collison
06174b6a0d Merge pull request #213 from nats-io/cluster_bcrypt_configs
Fix ports for cluster bcrypt auth config files in server package
2016-02-23 22:35:34 -08:00
Ivan Kozlovic
7becd0ceeb Fix ports for cluster bcrypt auth config files in server package
The ports were conflicting with the 'test' package when running
the test suite in parallel (go test -race -v ./...)
2016-02-23 21:32:48 -07:00
Derek Collison
cba523ba86 Merge pull request #212 from nats-io/cluster_auth_bcrypt
Support for bcrypt in cluster auth
2016-02-23 12:53:17 -08:00
Derek Collison
7237972420 support for bcrypt in cluster auth 2016-02-23 12:47:46 -08:00
Derek Collison
db5f42d54e Merge pull request #207 from wallyqs/connz-tls-ip-port
Set IP and Port for monitoring connections using TLS in /connz
2016-02-15 22:16:45 -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
Derek Collison
1f143a7b3e beta tag was being overloaded with lots of changes, so bumped 2016-02-11 16:40:22 -08:00
Derek Collison
4d3d070b35 Merge pull request #203 from nats-io/fix_route_ip
Return route's remote IP through INFO protocol
2016-02-11 16:38:22 -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
fc38a8336f Fix wrong check for error 2016-02-11 13:29:34 -07:00
Ivan Kozlovic
cef87212b9 Fix route url to use remote IP instead of configured url when sending in INFO protocol. 2016-02-11 11:23:41 -07:00
Derek Collison
50988b7411 Merge pull request #202 from nats-io/detect_route_to_self
Fix infinite server attempt to connect route to itself
2016-02-10 22:37:43 -08: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
Derek Collison
d77f416140 Merge pull request #201 from nats-io/update_connz_test
Update test that would catch incorrect NumConns
2016-02-09 11:55:58 -08:00
Ivan Kozlovic
193597dbab Update test that would catch incorrect NumConns
- Updating TestConnzWithOffsetAndLimit() to test for c.NumConns.
This would have caught the issue that was fixed in my previous change.

- Use of variable sortValue set to pair.Val to help readability. No functional change.
2016-02-09 12:40:20 -07:00
Derek Collison
416af2525c Merge pull request #199 from nats-io/connz_changes
Reduce number of objects needed to sort connections in HandleConnz
2016-02-08 21:47:03 -08:00
Ivan Kozlovic
e5f0dabe08 Reduce memory allocations + fix c.NumConns that may have been wrong.
c.NumConns was set early to len(s.clients). However, after the sort, it was possible that the actual Conns[] array be much smaller due to minoff/maxoff.
So c.NumConns is now updated only after applying the offsets.
In order to pre-allocate the Conns buffer, I no longer skip a client if tlsRequired is true and connection is gone. I will simply not update the TLSVersion and TLSCipher.
2016-02-08 20:46:22 -07:00
Ivan Kozlovic
08b8dd796a Fix test to check Idle instead of relying on client id.
Since client connections are handled in go routines, we don't have a guarantee that the second client's id will be > than the first.
2016-02-08 15:51:41 -07:00
Ivan Kozlovic
ecec51a771 Reduce number of objects require to sort connection in HandleConnz
- Use 'Pair' again, but this time, the key is an int64 that the selected sort field will be casted to.
We therefore have now only one type of sort.
- Check validity of sort string early on.
- Ensure that the ConnInfo's field used by the sort is not the value from 'client', but really the one
that was used for the sort.
- Added a test for sort by Idle time.
2016-02-08 15:40:42 -07:00
Derek Collison
d22b52b20e Merge pull request #198 from nats-io/fix_parallel_monitor_tests
Fix parallel monitor tests
2016-02-08 12:18:14 -08: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
Ivan Kozlovic
945fb0997a Fix missing return after Fatalf() calls.
Due to clash on monitor ports, running parallel tests could cause failure to create monitor listener. The missing return would then cause a nil pointer error when starting to server http requests.
2016-02-08 09:30:44 -07:00
Derek Collison
1a06713304 Merge pull request #197 from nats-io/monitor_race
Fix races in monitoring
2016-02-06 07:46:09 -08: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