Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13881 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92800 invoked by uid 1010); 17 Nov 2004 10:13:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 91752 invoked by uid 1007); 17 Nov 2004 10:13:26 -0000 Message-ID: <20041117101326.91741.qmail@pb1.pair.com> To: internals@lists.php.net Date: Wed, 17 Nov 2004 10:13:57 +0000 Organization: FCCN - =?ISO-8859-1?Q?Funda=E7=E3o_para_a_Computa=E7=E3?= =?ISO-8859-1?Q?o_Cientifica_Nacional?= User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <20041116105341.19378.qmail@pb1.pair.com> <419A1A65.5070009@townnews.com> In-Reply-To: <419A1A65.5070009@townnews.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 193.136.7.140 Subject: Re: [PHP-DEV] PHP broken pipe in fork From: user@domain.invalid The child process doesn't use any database connection, just to run some shell scripts, but it closes the connection anyway. I initialy used PEAR DB and then _pconnect functions but the result is the same. Was the bug solved two years ago ? How was it solved ? Thank you Rui Francisco Shaun Thomas wrote: > user@domain.invalid wrote: > >> 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. >