Commit Graph

655 Commits

Author SHA1 Message Date
ingosus
5145723164 Fix subscriptions zombie at autounsubscribe on cluster 2017-07-21 12:42:41 +03:00
Ivan Kozlovic
102b9ed3d4 Release 1.0.2
Essentially patch for Windows Docker Images.
2017-07-19 13:21:27 -06:00
Ivan Kozlovic
9ff62e21a9 Fix typos 2017-07-19 11:59:05 -06:00
Ivan Kozlovic
1fa136b21a Improved Config Reload test coverage
- Move the kill of a server in a cluster test to ensure that
  list of routes to remove is not empty.
- Change write_deadline reload value to 3s to make it different
  from default value
- Add test for option that does not support hot-swapping
2017-07-19 11:59:05 -06:00
Ivan Kozlovic
c1e295957d Merge pull request #547 from nats-io/fix_duplicate_route_handling
[FIXED] Handling of duplicate routes
2017-07-19 11:58:10 -06:00
Ivan Kozlovic
2befd973cc Fixed DATA RACE and ensure route is not created/accepted on shutdown
- Created a setter for the closed flag.
- Check if route is closed under lock and set a boolean if so,
  so we don't check c.route outside of c's mutex.
- Ensure that we do not create a route on shutdown, which would
  leave a connection hanging (was seen in some config reload tests).
2017-07-19 10:42:18 -06:00
Ivan Kozlovic
69891d37ac Fix import ordering 2017-07-19 09:02:25 -06:00
Ivan Kozlovic
9cddf0fcdf [FIXED] Windows Docker Image
The use of the `svc` API prevented the NATS Server to run as
a container on both nanoserver and windowsservercore Docker images.
An attempt was made to replace svc.Debug with normal server.Start()
if detected to be interactive, however, that did not work. The
fact of detecting if interactive or not already requires connecting
to the service controller apparently.
This change looks up for an environment variable (NATS_DOCKERIZED)
and if set to "1", will not make use of the `svc` package.
This environment variable will be set in the Docker image (in
nats-docker/windows/nanoserver/Dockerfile and windowsservercore/Dockerfile).

Resolves #543
2017-07-18 19:00:17 -06:00
Ivan Kozlovic
0e2882d741 [FIXED] Handling of duplicate routes
When A connects to B and B connects to A (either based on static
configuration - explicit routes, or because of auto-discovery -
implicit routes), it is possible that each server initially
registers the route from the opposite TCP connection. It will
then result in each server dropping the connection.

We were previously setting a retry flag in the first accepted route
based on the name of servers, which means that regardless of
duplicate detection, the server with the "smaller" server name would
try to reconnect when the route connection was closed. For instance,
suppose that server B connects to server A, when B disconnects, A
would try to reconnect once to B. This became problematic in the
case of configuration reload, because removing the route from B to
A would still result in a route created from A to B.

Also, when a route attempts a reconnect, a random delay is added
to avoid repeated failure cycles that may occur in case where
A connects to B and B to A.
2017-07-18 18:25:56 -06:00
Ivan Kozlovic
009362dd65 Prepare for next release 2017-07-12 09:57:32 -06:00
Ivan Kozlovic
56649b3273 [FIXED] Possible data race in routez when route disconnects (#540)
* [FIXED] Possible data race in routez when route disconnects

Resolves #539
2017-07-11 16:11:22 -06:00
Ivan Kozlovic
edc1d74c0c Use loopback for some config reload tests 2017-07-11 11:38:32 -06:00
Ivan Kozlovic
6755617914 Bumped timeout for checkClusterFormed and use stackFatalf() 2017-07-11 10:19:34 -06:00
Tyler Treat
136355f28e Merge branch 'master' of github.com:nats-io/gnatsd into fix_symlink_garbage 2017-07-11 10:39:43 -05:00
Tyler Treat
10c70cb570 Handle symlinks better
It's hard to implement a bulletproof solution for cleaning up the
symlinks created by config reload tests on failure since, for example,
there is nothing we can do when log.Fatal is called. Instead, prevent
the existence of a symlink from failing the tests if there is one
hanging around. Generally, these symlinks will not be left unless
os.Exit was called (as is the case with log.Fatal).
2017-07-11 10:35:29 -05:00
Ivan Kozlovic
28d4420a2c Fixed some config reload cluster tests
Use checkClusterFormed() to minimize risk of test failures due
to the subscription not being registered through the cluster.
2017-07-11 09:06:00 -06:00
Tyler Treat
dea34307f1 Merge branch 'master' of github.com:nats-io/gnatsd into fix_comment 2017-07-10 19:00:49 -05:00
Ivan Kozlovic
cae6b0b23a Some fixes
Use include so that we can have logfile and remote sys log tested
on platforms other than Windows.
Added some missing defer server.Shutdown() statements.
2017-07-10 16:33:19 -06:00
Tyler Treat
317a04f106 Fix error in test comment
The test is ensuring config reload fails when trying to change cluster
host.
2017-07-10 12:32:12 -05:00
Tyler Treat
ca1b3485cb Fix "error opening file" errors in tests for Windows
This sort of just punts on the problem by not creating log files in the
tests, but it seemed like the simplest solution.
2017-07-10 12:21:01 -05:00
Ivan Kozlovic
70b3b18535 Fix some tests
Fixing various tests that were failing locally when running in
parallel mode (without -p=1).
In reload_test.go, lots of nats.Conn.Close() were missing which
would require too much memory when running with `-race` mode.
2017-07-05 18:57:15 -06:00
Tyler Treat
2ed9c64f66 Merge branch 'master' of github.com:nats-io/gnatsd into enable_config_reload 2017-06-28 14:42:11 -05:00
Tyler Treat
54e23a3989 Enable syslog when running as Windows service
This writes logs to the Windows event log.
2017-06-28 14:16:26 -05:00
Tyler Treat
2a7af1b892 Move mpay field for memory alignment 2017-06-28 11:29:10 -05:00
Tyler Treat
901a5c7122 Address CR feedback 2017-06-28 11:05:02 -05:00
Tyler Treat
032b0b4cd7 Address CR feedback 2017-06-27 16:53:18 -05:00
Tyler Treat
84d00a0395 Add comment about random map iteration 2017-06-27 16:09:14 -05:00
Tyler Treat
dd3ad77ea8 Replace reloaded varz field with config_load_time 2017-06-27 14:33:06 -05:00
Tyler Treat
19d17b2ab3 Fix unit test 2017-06-27 12:58:13 -05:00
Tyler Treat
99015c4117 Allow specifying service name for Windows signaling 2017-06-27 12:42:48 -05:00
Tyler Treat
82f92e0939 Refactor signalling and add tests 2017-06-27 11:25:34 -05:00
Tyler Treat
4b05302e93 Make pid resolution more robust 2017-06-27 10:09:29 -05:00
Tyler Treat
2e6421683b Consolidate duplicate switch cases 2017-06-27 09:38:01 -05:00
Tyler Treat
4eea6f1557 Fix custom windows service control code 2017-06-26 17:39:17 -05:00
Tyler Treat
15ac59211a Use custom code to signal log file reopen 2017-06-26 15:18:57 -05:00
Tyler Treat
81e94ae4f1 Implement Windows service signalling 2017-06-26 11:41:53 -05:00
Tyler Treat
96ca09ee21 Add --signal flag 2017-06-26 10:50:23 -05:00
Tyler Treat
09550f0f09 Handle run errors 2017-06-23 13:56:32 -05:00
Tyler Treat
6708c6cdfd Implement gnatsd as a Windows service 2017-06-23 11:08:52 -05:00
Tyler Treat
cd18d848f8 Add signal for handling config reload 2017-06-23 10:03:29 -05:00
Tyler Treat
9adfae11a2 Add reload count to server for monitoring 2017-06-23 10:03:01 -05:00
Tyler Treat
a0f32a156d Fix grammatical mistake in docstring 2017-06-22 17:03:59 -05:00
Tyler Treat
88c864b2af Add reload support for ping interval, max pings, and write deadline 2017-06-22 17:01:56 -05:00
Tyler Treat
5501e288a8 Support syslog config reload 2017-06-22 16:33:33 -05:00
Tyler Treat
d60085d7c3 Replace mpay locking with atomic 2017-06-22 16:17:31 -05:00
Tyler Treat
b898b5561a Add reload support for pid_file, max_control_line, and max_payload 2017-06-22 14:48:40 -05:00
Tyler Treat
11c2720e0e Add support for reloading max_connections 2017-06-22 12:59:54 -05:00
Tyler Treat
8f5aa0433d Add support for reloading logtime and log_file 2017-06-22 12:59:13 -05:00
Tyler Treat
de76576348 Refactor config reload tests to reduce code duplication 2017-06-20 13:40:16 -05:00
Tyler Treat
579e9e9f28 Reduce test flakiness 2017-06-20 11:25:54 -05:00