Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13872 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32167 invoked by uid 1010); 16 Nov 2004 15:19:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32138 invoked from network); 16 Nov 2004 15:19:12 -0000 Received: from unknown (HELO dns1.systems.townnews.com) (208.229.121.1) by pb1.pair.com with SMTP; 16 Nov 2004 15:19:12 -0000 Received: from [10.81.10.35] (leepcF-123.sub-f.lee.net [12.163.57.123]) (authenticated bits=0) by dns1.systems.townnews.com (8.13.1/8.13.1) with ESMTP id iAGFJFlO025605 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Nov 2004 09:19:15 -0600 Message-ID: <419A1A65.5070009@townnews.com> Date: Tue, 16 Nov 2004 09:19:01 -0600 User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: user@domain.invalid CC: internals@lists.php.net References: <20041116105341.19378.qmail@pb1.pair.com> In-Reply-To: <20041116105341.19378.qmail@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP broken pipe in fork From: sthomas@townnews.com (Shaun Thomas) 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. -- Shaun M. Thomas INN Database Administrator Phone: (309) 743-0812 Fax : (309) 743-0830 Email: sthomas@townnews.com Web : www.townnews.com