-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FPM. access.log with stderr begins to write logs to error_log after daemon reload (GH-8885) #8913
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic looks good to me. Just few small things. Please add also some tests for this.
Also I added tests. |
Looks good to me but can you squash your changes please ? |
@devnexen I can, but as I know github has a checkbox with options "how to merge", including squash option. If it's not an option tell me and I will do it on y side. Thanks. |
Lets say I prefer to merge NEWS entry and the changes themselves in one go :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the C code is good. The test is a bit specific and I would rather not expose getPrefixedFile so if you could make it slightly more generic, that would be awesome.
// php-fpm must not be launched with --force-stderr option | ||
$tester = new FPM\Tester($cfg, '', [FPM\Tester::PHP_FPM_DISABLE_FORCE_STDERR => true]); | ||
// getPrefixedFile('err.log') is the same path that returns processTemplate('{{FILE:LOG}}') | ||
$errorLogFile = $tester->getPrefixedFile('err.log'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to get this integrated to the tester and introduce something like getErrorLogLines
maybe even have something like expectErrorLogLines
.
In terms of squashing, it is always helpful to have it done as we merge manually to lower branches and add notes to changelog (NEWS). Basically it saves us doing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requested changes are not really big issue and the author seems busy so approving.
Merged via f92505c |
SaltStack uses Python subprocess and redirects stderr to stdout which is then piped to the returned output. If php-fpm starts in daemonized mode, it should close stderr. However a fix introduced in phpGH-8913 keeps stderr around so it can be later restored. That causes the issue reported in phpGH-9754. The solution is to keep stderr around only when php-fpm runs in foreground as the issue is most likely visible only there. Basically there is no need to restore stderr when php-fpm is daemonized.
SaltStack uses Python subprocess and redirects stderr to stdout which is then piped to the returned output. If php-fpm starts in daemonized mode, it should close stderr. However a fix introduced in phpGH-8913 keeps stderr around so it can be later restored. That causes the issue reported in phpGH-9754. The solution is to keep stderr around only when php-fpm runs in foreground as the issue is most likely visible only there. Basically there is no need to restore stderr when php-fpm is daemonized.
SaltStack uses Python subprocess and redirects stderr to stdout which is then piped to the returned output. If php-fpm starts in daemonized mode, it should close stderr. However a fix introduced in phpGH-8913 keeps stderr around so it can be later restored. That causes the issue reported in phpGH-9754. The solution is to keep stderr around only when php-fpm runs in foreground as the issue is most likely visible only there. Basically there is no need to restore stderr when php-fpm is daemonized.
SaltStack uses Python subprocess and redirects stderr to stdout which is then piped to the returned output. If php-fpm starts in daemonized mode, it should close stderr. However a fix introduced in phpGH-8913 keeps stderr around so it can be later restored. That causes the issue reported in phpGH-9754. The solution is to keep stderr around only when php-fpm runs in foreground as the issue is most likely visible only there. Basically there is no need to restore stderr when php-fpm is daemonized.
SaltStack uses Python subprocess and redirects stderr to stdout which is then piped to the returned output. If php-fpm starts in daemonized mode, it should close stderr. However a fix introduced in GH-8913 keeps stderr around so it can be later restored. That causes the issue reported in GH-9754. The solution is to keep stderr around only when php-fpm runs in foreground as the issue is most likely visible only there. Basically there is no need to restore stderr when php-fpm is daemonized.
Fixes #8885