nginx/unit

Remove GET method support from the application restart control API endpoint

Opened this issue · 4 comments

#1445 will have added support for POST requests to restart applications alongside GET requests.

We should remove support for GET requests in Unit version 1.35 as it's semantically incorrect.

NAK.

This could end up breaking a lot of peoples scripts.

We will just need to live with it...

NAK.

I'm not familiar with this, what does this mean in this context?

No 4.

We will make this change. An effectful GET is a design flaw, and potentially a dangerous one. We'll do what we can to mitigate harm (graceful deprecation cycle, callouts on the blog, appropriate error logs during transition, and personal outreach to known users), but the longer we wait, the more painful this change will be.

The restart endpoint, today, can fail with an HTTP 500:

unit/src/nxt_controller.c

Lines 2426 to 2434 in 0e4342f

if (msg->port_msg.type == NXT_PORT_MSG_RPC_READY) {
resp.status = 200;
resp.title = (u_char *) "Ok";
} else {
resp.status = 500;
resp.title = (u_char *) "Failed to restart app.";
resp.offset = -1;
}

Sophisticated operators in heavily automated environments should already be prepared to handle and alert on failure. Less automated operators will likely be manually running scripts / sending requests; they'll see appropriate error messages.