[RFC] Wall clock time based execution time

  115581
July 25, 2021 11:43 deleugyn@gmail.com (Deleu)
Hello everyone!

A few months ago there was a proposed RFC for having wall clock time for
timeout [1]. It seemed like there was not a lot of push back against it [2]
with an exception of Nikita's comment about having 2 ini settings vs having
a toggle on the existing ini setting [3]

[1] https://wiki.php.net/rfc/max_execution_wall_time
[2] https://externals.io/message/112492#113210
[3] https://github.com/php/php-src/pull/6504#issuecomment-743064911

The reason I'm bringing this up is because I'm interested in the
possibility of having this functionality in PHP as a potential solution for
serverless environment hard limits. The number #1 issue with running PHP on
AWS Lambda via Bref is caused by API Gateway having a hard limit of 30
seconds. When combining that with the fact that AWS Lambda inside VPC loses
internet connectivity (unless a NAT Gateway / NAT Instance exists in the
VPC), it's extremely common to have code attempting to connect to a
database, make an API call or try to upload data into S3 and get confronted
with Server Error - Task timed out. This gets aggravated by the fact that
we have no opportunity to flush out logs, meaning any attempt to write logs
to stderr is simply lost and it makes it an arduous task to debug.

I did a quick testing around register_shutdown_function and it seems to
provide what we need if we had wall time-based timeout.

```

    
  115582
July 25, 2021 12:06 kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=)
Hi Deleu,

What a coincidence! I've just added my PR to the "PHP 8.2" milestone on
GitHub. That means, I'll definitely want to continue the work on this
proposal
as soon as I finish my previous tasks.

The reason that I delayed this RFC is that it lacked feedback and answers
to my latest questions. Also, Nikita's comment which you linked, made me
less
confident, so I didn't want to push the proposal any further until
the details were clarified. In the meantime, I started a few other RFC-s
which took all my time.
With all that said, I plan to ping the original discussion thread in the
following weeks/months.

Regards,
Máté
  115590
July 27, 2021 09:56 deleugyn@gmail.com (Deleu)
On Sun, Jul 25, 2021 at 2:07 PM Máté Kocsis <kocsismate90@gmail.com> wrote:

> Hi Deleu, > > What a coincidence! I've just added my PR to the "PHP 8.2" milestone on > GitHub. That means, I'll definitely want to continue the work on this > proposal > as soon as I finish my previous tasks. > > The reason that I delayed this RFC is that it lacked feedback and answers > to my latest questions. Also, Nikita's comment which you linked, made me > less > confident, so I didn't want to push the proposal any further until > the details were clarified. In the meantime, I started a few other RFC-s > which took all my time. > With all that said, I plan to ping the original discussion thread in the > following weeks/months. > > Regards, > Máté > > That's really good to hear. If there's anything I can do to help, don't
hesitate to reach out! -- Marco Aurélio Deleu