Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13873 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43991 invoked by uid 1010); 16 Nov 2004 16:05:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38525 invoked by uid 1007); 16 Nov 2004 16:04:15 -0000 Message-ID: <20041116160415.38515.qmail@pb1.pair.com> To: internals@lists.php.net References: <20041116105341.19378.qmail@pb1.pair.com> <419A1A65.5070009@townnews.com> Date: Tue, 16 Nov 2004 08:04:09 -0800 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Posted-By: 64.142.6.231 Subject: Re: [PHP-DEV] PHP broken pipe in fork From: pollita@php.net ("Sara Golemon") >> I'm using a query in loop and go through all records to do some >> operations in the middle of the script i fork(); to do other things >> When i return to the parent process i try to make one update and i >> get the following error [nativecode=Unable to complete network >> request to host "127.0.0.1". Error writing data to the connection. >> Broken pipe] > > That would be a fairly well known issue with PHP. You're running into > the same thing we encountered about 2 years ago. What happens is that > your child process is closing the mysql connection as part of its > standard PHP cleanup procedures, leaving the parent with a broken > connection. > > I'd recommend provisioning a method so that your child makes its own new > connection, and does not use the parent's connection at all. Since all > php scripts clean up before exiting, you need to make sure all resources > in use by the child are not needed by the parent after the child exits. > Or just use persistent resources (i.e.: mysql_pconnect() ) -Sara