Bug #53287 [Fbk-Asn]: PDO 5 Byte write to a broken pipe when forked

2011-01-31 Thread bryan dot tong at gigenet dot com
Edit report at http://bugs.php.net/bug.php?id=53287edit=1

 ID: 53287
 User updated by:bryan dot tong at gigenet dot com
 Reported by:bryan dot tong at gigenet dot com
 Summary:PDO 5 Byte write to a broken pipe when forked
-Status: Feedback
+Status: Assigned
 Type:   Bug
 Package:PDO related
 Operating System:   CentOS 5.5 x86-64
 PHP Version:5.3SVN-2010-11-10 (snap)
 Assigned To:mysql
 Block user comment: N
 Private report: N

 New Comment:

Though it can really make parsing the output a pain when there are
multiple versions of mysqlnd floating about.


Previous Comments:

[2011-01-31 10:27:42] u...@php.net

This does not smell like an error rather more like mysqlnd being more
verbose. No bug, a feature, I'd say.


[2010-12-05 21:23:46] seza at paradoxal dot org

I have the same error message with php.5.3.3 (send of 5 bytes failed
with errno=32 Broken pipe) but in a 

different context more simply to reproduce :



I have a simple website (no fork or stuff like that). It make persistent
connection with pdo to mysql 

(mysqlnd). The errors are raised when the mysql is server is restarted.



When mysql server is off error message are mysql server is gone away. No
problem with that but once the 

mysql server is restarted and during 15 minutes I have sometimes this
error message (send of 5 bytes 

failed with errno=32 Broken pipe). 

Certainly a reuse of a cached connection to mysql before it was
restarted.



PS : I use mysql_sock connection
(mysql:unix_socket=/var/run/mysqld/mysqld.sock)


[2010-11-26 13:19:45] johan...@php.net

The description mentions forking, the sample code not. Please provide a
complete script showing the issue.


[2010-11-10 03:21:00] bryan dot tong at gigenet dot com

Description:

When switching from PHP 5.1.6 to PHP 5.3.3 the following notice has
begun to show up in our scripts.



PDO::__construct(): send of 5 bytes failed with errno=32 Broken pipe



We are running a daemon and the forked children throw this error on the
PDO construct that is used to refresh the class.



The error changes depending on whether a persistent connection is set or
not.



When persistent is on the above error is produced. Without persistent
connection applied the error is thrown when the class is destructed.



Example: $pdo = null;

send of 5 bytes failed with errno=32 Broken pipe



We have confirmed this to be apparent in PHP 5.3.3 and the trunk build.
I was unable to test on 5.2, but I was able to confirm this bug does not
occur on 5.1.6



I have tried wrapping ob functions around the calls in case the broken
pipe happened to be stdout but I think it is the mysql socket that is in
question. On that same note, switching mysql to connect via tcp did not
help.



From searching I found a site that threw this error but no discussions
of it.



Let me know any additional information that is needed.

Test script:
---
// without persistance

public static function shutdown(){

$base = Base::getBase();

$base-db = null;

self::$base = false;

}



// with persistance

$this-pdo = new PDO(

$dsn,

$user,

$pass,

array(

PDO::ATTR_ERRMODE   =  PDO::ERRMODE_EXCEPTION,

PDO::ATTR_PERSISTENT=  true

)

);

Expected result:

The PDO class should startup quietly when persistent connections are
enabled and destruct quietly when persistent connections are disabled.

Actual result:
--
PDO::__construct(): send of 5 bytes failed with errno=32 Broken pipe
with persistent connections.



Base::shutdown(): send of 5 bytes failed with errno=32 Broken pipe
without persistent connections.



I believe this problem is only related to forked processes. I have
confirmed the standard page serving to not throw this.














-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53287edit=1


[PHP-BUG] Bug #53287 [NEW]: PDO 5 Byte write to a broken pipe when forked

2010-11-09 Thread bryan dot tong at gigenet dot com
From: 
Operating system: CentOS 5.5 x86-64
PHP version:  5.3SVN-2010-11-10 (snap)
Package:  PDO related
Bug Type: Bug
Bug description:PDO 5 Byte write to a broken pipe when forked

Description:

When switching from PHP 5.1.6 to PHP 5.3.3 the following notice has begun
to show up in our scripts.



PDO::__construct(): send of 5 bytes failed with errno=32 Broken pipe



We are running a daemon and the forked children throw this error on the PDO
construct that is used to refresh the class.



The error changes depending on whether a persistent connection is set or
not.



When persistent is on the above error is produced. Without persistent
connection applied the error is thrown when the class is destructed.



Example: $pdo = null;

send of 5 bytes failed with errno=32 Broken pipe



We have confirmed this to be apparent in PHP 5.3.3 and the trunk build. I
was unable to test on 5.2, but I was able to confirm this bug does not
occur on 5.1.6



I have tried wrapping ob functions around the calls in case the broken pipe
happened to be stdout but I think it is the mysql socket that is in
question. On that same note, switching mysql to connect via tcp did not
help.



From searching I found a site that threw this error but no discussions of
it.



Let me know any additional information that is needed.

Test script:
---
// without persistance

public static function shutdown(){

$base = Base::getBase();

$base-db = null;

self::$base = false;

}



// with persistance

$this-pdo = new PDO(

$dsn,

$user,

$pass,

array(

PDO::ATTR_ERRMODE   =  PDO::ERRMODE_EXCEPTION,

PDO::ATTR_PERSISTENT=  true

)

);

Expected result:

The PDO class should startup quietly when persistent connections are
enabled and destruct quietly when persistent connections are disabled.

Actual result:
--
PDO::__construct(): send of 5 bytes failed with errno=32 Broken pipe with
persistent connections.



Base::shutdown(): send of 5 bytes failed with errno=32 Broken pipe without
persistent connections.



I believe this problem is only related to forked processes. I have
confirmed the standard page serving to not throw this.









-- 
Edit bug report at http://bugs.php.net/bug.php?id=53287edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53287r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53287r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53287r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53287r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53287r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53287r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53287r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53287r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53287r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53287r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53287r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53287r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53287r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53287r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53287r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=53287r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=53287r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=53287r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=53287r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=53287r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=53287r=mysqlcfg