Frank Schroeder ea5b0f2c7c agent: fix 'consul leave' shutdown race (#2880)
When the agent is triggered to shutdown via an external 'consul leave'
command delivered via the HTTP API then the client expects to receive a
response when the agent is down. This creates a race on when to shutdown
the agent itself like the RPC server, the checks and the state and the
external endpoints like DNS and HTTP.

This patch splits the shutdown process into two parts:

 * shutdown the agent
 * shutdown the endpoints (http and dns)

They can be executed multiple times, concurrently and in any order but
should be executed first agent, then endpoints to provide consistent
behavior across all use cases. Both calls have to be executed for a
proper shutdown.

This could be partially hidden in a single function but would introduce
some magic that happens behind the scenes which one has to know of but
isn't obvious.

Fixes #2880
2017-06-21 05:52:51 +02:00
..
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2015-01-25 05:00:52 +01:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00
2017-06-10 18:52:45 +02:00