- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
pcntl_fork causing “errno=32 Broken pipe” #474
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
Comments
Hey there, While I don't know specifically why, I have a strong suspicion that the Zend library might get a little quirky around sockets within the context of a forking. That being said, I'll see if I can replicate your issue based on the stack overflow question you mentioned. Cheers dude, |
Brilliant thanks. For the time being I have just disabled php notice errors for the scripts that fork. Makes my log files a little quieter ;) |
Hi. I was woundering if you have had chance to look into this yet? |
Bump* |
+1 Also seeing this issue with workers that fork in PHPResque https://github.com/chrisboulton/php-resque |
+1 also seeing this in php resque workers. Appears harmless... guessing its "QUIT\r\n" |
(Broken by phpredis/phpredis#474)
I know how to fix this bug. Just close the connect to redis before pcntl_fork and re-connect to redis after pcntl_fork. |
no updates? |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Same here. PHP 5.5.9, phpredis 2.2.7 Simple script to replicate this bug https://gist.github.com/lexaurin/8897f1be48b9e8747b7d/e8a5fcd750623b6fc250f9c529fc2e65cc55893a Expected result:
Actual result:
Connections before script (
Connections after first child forked:
Connections after second child forked:
Connections after third child forked:
Note: Fact that child closes "both" connections at the end is right (since it shares file descriptor with parent). |
Modified my gist a bit to see which process produces notice https://gist.github.com/lexaurin/8897f1be48b9e8747b7d/d46ccd5c2ffabb1c3a09118db80654cb382c6c96 My log:
|
I have same problem, I use pconnect to connect redis. After fork, I pconnect again, But nothing help. Sometime always throw exception like this.
This code just manager jobs, and run it.
Then the unix crontab will run it. Same job will pconnect Redis, after pcntl_fork() pconnect Redis can't fix |
+1 |
Having the same issue when using https://github.com/kriswallsmith/spork |
this bug is from php pcntl, just in the worker colse redis, will solve this problem. |
Same issue happens when using PHP 5.5.9 + phpredis 2.2.7 + redis engine 2.8.19 + Magento CE 1.9.0.1 + Cm_Cache_Backend_Redis environment.
|
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 :) |
+1 |
2 similar comments
+1 |
+1 |
You guys know there's now a "+1" equivalent "like button" on GitHub right? Without spamming the participants with emails (unless that's your objective!) |
+1 |
php 5.5.9 suddenly started doing same behaviour. I cannot use it anymore in production. This is high priority bug |
Could someone provide script which cause this error? |
@lexaurin, thanks.
Tested on php5.3-php7.1 |
@lexaurin depends environment? |
I can't reproduce it on my desktop too (PHP 7.0.8-0ubuntu0.16.04.3) Problem was on Debian machine a while ago and I don't have access there anymore. PHP 5.5.9, phpredis 2.2.7 at that time. Maybe someone with "+1" can provide more infomration and test it out. |
phpredis 2.2.7 is to old. problem may be fixed long time ago :) |
I know, it was reported in 2014. If no one can confirm it on newer versions of phpredis I suggest to close this bug with resolution "Upgrade to 3.x" |
Env: PHP7.1.0+phpredis-3.1.0 |
Same error happen to me under debian8, redis 3.2.7, with php7.0 & Mediawiki 1.28. |
Same error happens to me under CentOS 6 , Redis 3.2.1 with PHP 7.0 & Magento 2
|
@ppanphper, @zoglun, @ngoctruongbc, do you have a script to reproduce this issue? |
In my opinion this should be closed as it's a duplicate of #70 -- the broken pipe is the effective result that leads to all sorts of read/write errors. @yatsukhnenko Script to reproduce is here: #70 (comment) |
Duplicate #70 |
Same error happens in swoole worker... |
Hi
I am having issues with PHP notices after upgrading from php 5.4.26 to 5.4.28. I original thought it was a php issue but it may be related to this Redis extension.
The full details can be found here http://stackoverflow.com/questions/23713480/after-php-upgrade-pcntl-fork-causing-errno-32-broken-pipe
But basically when I am forking, whenever a child closes, except for the first child, I get an error saying:
It feels like the first child is closing the connection to Redis and then the following children try and close the same connection.
It appears that this has only just started being an issue since either PHP 5.4.27 or 5.4.28
Could this be a phpredis issue?
I have Redis Version => 2.2.5 installed
The text was updated successfully, but these errors were encountered: