Skip to content

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

WoZ
Copy link
Contributor

@WoZ WoZ commented Jul 3, 2022

Fixes #8885

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.

The logic looks good to me. Just few small things. Please add also some tests for this.

@WoZ
Copy link
Contributor Author

WoZ commented Jul 4, 2022

Also I added tests.

@WoZ WoZ requested a review from bukka July 4, 2022 17:04
@WoZ
Copy link
Contributor Author

WoZ commented Jul 21, 2022

@bukka @devnexen may you review this? this issue affects us =(

@devnexen
Copy link
Member

Looks good to me but can you squash your changes please ?

@WoZ
Copy link
Contributor Author

WoZ commented Jul 23, 2022

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

@devnexen
Copy link
Member

Lets say I prefer to merge NEWS entry and the changes themselves in one go :)

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 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');
Copy link
Member

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.

@bukka
Copy link
Member

bukka commented Jul 25, 2022

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 git rebase -i ...

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.

The requested changes are not really big issue and the author seems busy so approving.

@bukka
Copy link
Member

bukka commented Aug 29, 2022

Merged via f92505c

@bukka bukka closed this Aug 29, 2022
bukka added a commit to bukka/php-src that referenced this pull request Oct 29, 2022
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.
bukka added a commit to bukka/php-src that referenced this pull request Oct 29, 2022
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.
bukka added a commit to bukka/php-src that referenced this pull request Oct 29, 2022
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.
bukka added a commit to bukka/php-src that referenced this pull request Oct 29, 2022
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.
bukka added a commit that referenced this pull request Oct 30, 2022
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.
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.

FPM. access.log with stderr begins to write logs to error_log after daemon reload
3 participants