Files
nats-server/server
Ivan Kozlovic 9288283d90 Fixed accept loops that could leave connections opened
This was discovered with the test TestLeafNodeWithGatewaysServerRestart
that was sometimes failing. Investigation showed that when cluster B
was shutdown, one of the server on A that had a connection from B
that just broke tried to reconnect (as part of reconnect retries of
implicit gateways) to a server in B that was in the process of shuting down.
The connection had been accepted but createGateway not called because
the server's running boolean had been set to false as part of the shutdown.
However, the connection was not closed so the server on A had a valid
connection to a dead server from cluster B. When the B cluster (now single
server) was restarted and a LeafNode connection connected to it, then
the gateway from B to A was created, that server on A did not create outbound
connection to that B server because it already had one (the zombie one).

So this PR strengthens the starting of accept loops and also make sure
that if a connection (all type of connections) is not accepted because
the server is shuting down, that connection is properly closed.

Since all accept loops had almost same code, made a generic function
that accept functions to call specific create connection functions.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-06 17:03:19 -06:00
..
2020-06-12 15:48:38 -07:00
2019-10-15 23:55:13 +08:00
2020-05-19 14:15:11 -07:00
2020-06-26 10:29:53 -07:00
2020-07-03 11:30:48 -06:00
2020-07-01 07:33:34 -07:00
2020-07-01 08:13:24 -07:00
2020-02-25 19:53:09 -05:00
2020-06-17 15:10:41 -04:00
2020-06-18 21:04:34 -07:00
2020-06-26 10:29:53 -07:00
2019-05-06 15:41:38 -07:00
2020-06-26 09:03:22 -07:00
2019-12-12 11:58:24 -07:00
2018-12-06 15:09:14 -08:00
2020-06-01 18:00:13 -04:00
2020-06-18 19:27:42 +03:00
2020-06-26 09:03:22 -07:00
2020-06-12 10:03:47 -06:00
2018-10-06 14:06:14 -07:00
2018-03-15 22:31:07 -07:00
2019-11-14 20:05:32 -07:00
2018-03-15 22:31:07 -07:00
2019-11-14 20:05:32 -07:00
2019-11-14 20:05:32 -07:00
2019-12-12 11:58:24 -07:00
2020-06-02 06:24:46 -07:00
2020-06-01 16:54:41 -07:00