-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
FPM. access.log with stderr begins to write logs to error_log after daemon reload #8885
Comments
This is a known issue: see https://bugs.php.net/bug.php?id=73886 |
Unfortunately this is not considered as a bug because |
@bukka I saw the ticket you mentioned. I don't think it's the same issue and that
|
Ok I looked a bit more into this. First of all I agree that this is a different issue and it looks really like a bug. The reason for this is that initially the access log is open before |
@bukka I prepared PR, please, check it. Some test has failed. That's because of changes in log output and some flow of processing. I will fix them after the principal agreement on this approach. Thank you. |
Some details of testing.
Then code in PR calls dup and makes a record about this.
The last line is generated by the Then I launch <?php
file_put_contents('php://stdout', 'To stdout');
file_put_contents('php://stderr', 'To stderr');
Then run
stderr fd was restored.
Let's launch
All looks good. USR1
The error_log:
strace:
All looks fine. Other bugsThese bugs aren't related to this ticket, but it worth to mention them.
|
…aemon reload (phpGH-8885). Tests.
Description
Configuration:
With this configuration records that are expected to be in the stderr appear in the stderr, but till the first reload with
SIGUSR2
command. After reload they appear in theerror_log
file configured in thephp-fpm.conf
.php-fpm
is launched in docker container (official one), foreground mode, without--force-stderr
.Actual result:
Record in the file configured in the
php-fpm
error_log
Expected result: access log record appears in the stderr.
Details
I prepared the demo setup. https://github.com/WoZ/php-fpm-issue-8885
You may use it to reproduce the issue. Check my repo and you may find instructions in the README.md.
Also, I added strace output and some analysis I did.
As I see, the method that does
dup2
isfpm_stdio_init_final
and it's called fromfpm_init
.PHP Version
All versions are affected
Operating System
Alpine, but actually all OSes are affected
The text was updated successfully, but these errors were encountered: