Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112573 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 80075 invoked from network); 21 Dec 2020 12:49:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Dec 2020 12:49:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A6081804DD for ; Mon, 21 Dec 2020 04:21:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 21 Dec 2020 04:21:28 -0800 (PST) Received: by mail-lf1-f53.google.com with SMTP id b26so13640535lff.9 for ; Mon, 21 Dec 2020 04:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SYuiVjQndgMdhs/hOuUbSuh2r9iX/uuVkGdFp7O/miQ=; b=Fl/D+Zp8mLfAmPA+7w0UgT+PeDhgZiLkNDGIZn/+aWmp/pPuniMxX0/+YBStDDfipG 1n0SJQ9FyzHx6iBJIgjnt/DhwsGFGa8T/AxccA45fMsnZIjtStDQnophobplyk73c4I5 9Ik/Dcfu9QsJjQvA+R9nlBOOmVZkhyjwqI2Rw72laoiTdny0X26wFGz1b2GPgZ0XuPjS 1yMFIbIbY0sP95Fc8y8/hvmlOv9aGVBkppPTVsEgvCOKy1uH0TAuzB7fco44ksDR/Xf6 HZ/hQFualNnZmOZIUgWgUzMHFcPVBZmr2WwfAozeDEsJESpl3US3mSeoRK2HDTxFvd1n ra7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SYuiVjQndgMdhs/hOuUbSuh2r9iX/uuVkGdFp7O/miQ=; b=SJVKxeMRFzmPU3NmrSeEIkvIFPe89g0mWYXBU5NjHpRljOx3jda3NaS+PYyYFSr6Q/ E3rjjvWq5xTSXE9reik4CD8LgyU/5ERPinhXbXFkAhsLrrSLXePg3HgBKMgOHJMcJAkW dEqSJhHPal9VDKyAWhL6EyEDVf6VFHptCVGDCow5ih7hA/mY+4GDBvUawlKHZdrtI45q 0igjQyLjWPSwbZWBXVPkGjw6baQllEhhcNEAfU5V3thbG/FVY9QOtnaJd7fYb4zUq6QO 1rpwJG04vlBMHLdIAaWi9SQIO2NdDGEEdXuirUWZoPRnqgBNG4n9MnmcjMdilgVNRDpw 6suw== X-Gm-Message-State: AOAM530Nkr/KI5jakSBtdeOTnUD565oYAuqDMlRKD1kv1Z70fHAo650v Ti17ZJYUVou/gE7ezea0/J7LCW9J493vgjvd7J8= X-Google-Smtp-Source: ABdhPJx3kpxauew3XuypQ6LxZyXnK9sUu59/YnrHsLDIO6evYYLVzyKgPT9W2NFeWovTjoEwebHGigBvE3L8z8pcPR8= X-Received: by 2002:a19:7f90:: with SMTP id a138mr6630215lfd.617.1608553287318; Mon, 21 Dec 2020 04:21:27 -0800 (PST) MIME-Version: 1.0 References: <9b36af8a-270f-2796-194e-b50296522407@gmail.com> In-Reply-To: Date: Mon, 21 Dec 2020 13:21:16 +0100 Message-ID: To: Peter Bowyer Cc: Rowan Tommins , PHP Internals List Content-Type: multipart/alternative; boundary="0000000000004aff7a05b6f87f6d" Subject: Re: [PHP-DEV] [RFC] [Discussion] Measuring maximum execution time based on wall-time From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --0000000000004aff7a05b6f87f6d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Rowan and Peter, Tangentially, can this be considered a bug in FPM's handling? I appreciate > the speed boost FPM brought over CGI, but the more I work with it the les= s > I like the way it functions (but that is a separate conversation). > No, I don't think so, since FPM terminates the child process by sending a SIGTERM (rather than a SIGKILL), it seems that it does the right thing based on the source code. But I'd appreciate it if someone more familiar with FPM or process management could verify my assumptions. Actually, this may be part of the confusion: I'm not sure what you're > referring to by "distributed systems", so don't know whether I'm > included in the set of developers you're picturing here. My definition of "distributed system" is when there is a network boundary between components of an application. Practically speaking, this is the cas= e when the application code and the database/cache/sessions etc. are on different servers. So, again, it comes down to whether this is a "last resort" setting, or > something you'd expect to be invoked regularly. Yes, I certainly imagine it as a last resort possibility which could supersede FPM's "request_terminate_timeout" or the other external timeout mechanisms that are currently in use. In fact, "max_execution_wall_timeout" is not effective alone, it has to be used in cooperation with other timeout settings either on the caller (PHP) or the callee (e.g. database) side, since external calls cannot be cancelled midway by PHP. That said, setting cURL, socket etc. timeouts is still highly encouraged as a regular countermeasure. My purpose with this RFC is to improve the last safety net we have (real execution timeout), which I find suboptimal in its current form. You missed the key part of the quote you replied to here, which is > "return partial results". My point was not about the *formatting* of the > error, but that its *content* might need to be application-specific. Ah, sorry, I did really miss it! I think my answer still holds though: if there is such a requirement, developers can ignore this ini setting (or explicitly set its value to 0, if necessary). Probably this is a good example why we should not make wall-clock time based measurement the default of "max_execution_time". Otherwise, I think my proposal would offer a solution for the 90% of the problems we currently have due to the way how "max_execution_time" works. It might be useful to expand on this in the RFC, remembering that > "RSHUTDOWN" doesn't mean anything to a userland developer. Will > "finally" blocks be run? Destructors? Will the error handler be invoked? > I know the answers are probably "the same as the current timeout > setting", but spelling it out would help to picture when this feature > might or might not be useful. I absolutely agree, and I'll try to elaborate as soon as I touch the RFC again, most probably today. Your answer is true, it is "the same as the current timeout setting". However, I was considering the possibility to throw an exception in case of the new timeout, but I think this task would be more suitable for a PHP 9.0 release where we could convert fatal errors to exceptions where it would make sense. M=C3=A1t=C3=A9 --0000000000004aff7a05b6f87f6d--