Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GET method support from the application restart control API endpoint #1446

Open
javorszky opened this issue Sep 27, 2024 · 4 comments
Milestone

Comments

@javorszky
Copy link
Contributor

javorszky commented Sep 27, 2024

#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.

@ac000
Copy link
Member

ac000 commented Sep 27, 2024

NAK.

This could end up breaking a lot of peoples scripts.

We will just need to live with it...

@javorszky
Copy link
Contributor Author

NAK.

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

@ac000
Copy link
Member

ac000 commented Sep 27, 2024

No 4.

@callahad
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants