linkerd-tcp icon indicating copy to clipboard operation
linkerd-tcp copied to clipboard

`/shutdown` on the admin port no longer results in the process shutting down

Open stevej opened this issue 7 years ago • 1 comments

$ curl -X POST -vvvv  http://127.0.0.1:9989/shutdown
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 9989 (#0)
> POST /shutdown HTTP/1.1
> Host: 127.0.0.1:9989
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 0
< Date: Tue, 11 Jul 2017 22:50:51 GMT
<
* Curl_http_done: called premature == 0
* Connection #0 to host 127.0.0.1 left intact

A few minutes later, the process is still running.

stevej avatar Jul 11 '17 22:07 stevej

I did some digging, and it looks like this is because the admin thread never actually joins – when it receives the /shutdown endpoint, it sends the shutdown signal on Closer but then just happily goes back to serving the admin service.

I'm guessing that the correct behavior is either to wait the grace period and then exit, or to wait until all the router threads have joined, and then exit? If the latter, then the admin thread will presumably need some way of knowing if the router threads have joined, which it doesn't currently have...

hawkw avatar Jul 19 '17 19:07 hawkw