Skip to content

Make /ping of php-fpm work again #13980

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

Closed
wants to merge 2 commits into from

Conversation

Wilhansen
Copy link
Contributor

@Wilhansen Wilhansen commented Apr 16, 2024

The ping feature of php-fpm monitoring was previously not working (but the status is) due to the configuration variables ping.path and ping.response not being copied over to the worker when forked (but pm.status_path does). This results in the ping code path being disabled because the worker detects that ping.path is not configured.

@Wilhansen Wilhansen requested a review from bukka as a code owner April 16, 2024 16:53
@devnexen
Copy link
Member

Your changes makes sense but seems to qualify as bug fix. Might be possible to target PHP-8.2 branch instead.

@bukka
Copy link
Member

bukka commented Apr 17, 2024

The problem with this is that the ping can be currently used for readiness and identifying if FPM is responsive. This change might change it. I need to think about this.

@Wilhansen
Copy link
Contributor Author

Wilhansen commented Apr 18, 2024

Your changes makes sense but seems to qualify as bug fix. Might be possible to target PHP-8.2 branch instead.

got it, will do so and rebase to php-8.2 branch.

(update: done, but i could not figure out how to add the bugfix label)

The ping feature of php-fpm monitoring was previously not working due to the configuration variables ping.path and ping.response not being copied over to the worker when forked. This results in the ping code path being disabled because the worker detects that ping.path is not configured.
@Wilhansen Wilhansen force-pushed the php-fpm-ping.path-fix branch from 210b346 to 23190c9 Compare April 18, 2024 04:21
@Wilhansen
Copy link
Contributor Author

Wilhansen commented Apr 18, 2024

The problem with this is that the ping can be currently used for readiness and identifying if FPM is responsive. This change might change it. I need to think about this.

we were planning to use the ping feature for this, but it kept on returning a 404 despite /status working which is why i started looking into it
image

@Girgias Girgias removed their request for review April 18, 2024 14:28
@bukka
Copy link
Member

bukka commented Apr 19, 2024

@Wilhansen Can you actually create an issue and describe the whole issue with all info including all config files. It's useful for linking the fix with that.

@bukka
Copy link
Member

bukka commented Apr 19, 2024

And mainly useful for me as a reminder to look into and see the exact problem that you have.

@Wilhansen
Copy link
Contributor Author

@Wilhansen Can you actually create an issue and describe the whole issue with all info including all config files. It's useful for linking the fix with that.

posted a bug report here: #14037

@adoy
Copy link
Member

adoy commented Jun 14, 2024

The patch looks good to me.

The problem with this is that the ping can be currently used for readiness and identifying if FPM is responsive. This change might change it. I need to think about this.

If the end user plans to use the /ping route for readiness checks, they should use the regular endpoint. This way, if all children are busy, FPM will not be considered ready to serve new requests, and the readiness check will fail appropriately. However, if the end user plans to use the /ping route for liveness checks, they should use the status_listen endpoint. This ensures that the process is not incorrectly killed for being unresponsive.

Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this and I can see the use case. It's something between feature and a bug (omission) as obviously status_listen was meant just for status but considering that adding the functionality cannot cause any breaking issue so I'm happy to accept it as a bug and merge it to 8.2

@bukka bukka closed this in 43bc53a Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants