Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47446 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25017 invoked from network); 22 Mar 2010 15:14:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2010 15:14:19 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.134 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.134 mailout2.netbeat.de Linux 2.6 Received: from [83.243.58.134] ([83.243.58.134:53147] helo=mailout2.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/B1-14451-94987AB4 for ; Mon, 22 Mar 2010 10:14:19 -0500 Received: (qmail 14640 invoked by uid 89); 22 Mar 2010 15:09:32 -0000 Received: from unknown (HELO ?192.168.1.28?) (postmaster%schlueters.de@93.104.57.142) by mailout2.netbeat.de with ESMTPA; 22 Mar 2010 15:09:32 -0000 X-Originator: 9e51b244e0a38413ab6a9876e36ba9df To: troels knak-nielsen Cc: PHP Developers Mailing List In-Reply-To: <98b8086f1003220751j73a8414es89b9b469c46f6630@mail.gmail.com> References: <98b8086f1003220751j73a8414es89b9b469c46f6630@mail.gmail.com> Content-Type: text/plain; charset="UTF-8" Organization: php.net Date: Mon, 22 Mar 2010 16:14:12 +0100 Message-ID: <1269270852.1575.141.camel@guybrush> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] Raise warning first on "Maximum execution time exceeded" From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2010-03-22 at 15:51 +0100, troels knak-nielsen wrote: > We log all errors that happens in our production environment, but as > fatal errors can't be handled from within php, we end up with little > information to go on for further debugging. I'm not very familiar with > the php internals code, but I managed to throw in a hack that appears > to work. In the handler function for timeouts (zend_timeout), I raise > a WARNING, sleep for 1 second and then resume normal behavior, which > results in a fatal error. This gives userland code 1 second to log the > error somewhere, which should be sufficient for debugging. A one second delay is no option there. And what actually happens is that the warning triggers your custom error handler. After that it sleeps then it dies. This also creates a "nice" way to extend the script runtime after the timeout occurred. aka. making the timeout useless for many scenarios it was meant for. johannes