bref: Unrecoverable state on Socket Exception

When Lambda enters in the catch section of the responder exception, it will never recover until AWS decides to kill it.

        try {
            $responder->send($requestHeaders, $requestBody);
        } catch (HoaFastCgiException|HoaSocketException $e) {
}

I am investigating what we can do in order to fix this issue.

I Already tried:

1 - killExistingFpm - it does kill, but the process stays as defunct and waitUntilStopped always return timeout error exception. 2 - killExistingFpm removing the waitUntilStopped, this “works” as fpm again loads, but the socket never attach to it… 3 - used shell_exec to kill the process and results the same as 1

Will update here when I have more results… Feel free to drop your penny here.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (19 by maintainers)

Most upvoted comments

Ok more insights…

[18-Mar-2019 15:11:19] NOTICE: fpm is running, pid 9
[18-Mar-2019 15:11:19] NOTICE: ready to handle connections
START RequestId: 0786516c-6853-47c0-a90e-953d84185929 Version: $LATEST
END RequestId: 0786516c-6853-47c0-a90e-953d84185929
REPORT RequestId: 0786516c-6853-47c0-a90e-953d84185929	Init Duration: 581.29 ms	Duration: 820.43 ms	Billed Duration: 1500 ms Memory Size: 704 MB	Max Memory Used: 88 MB	
START RequestId: e855a430-023c-4396-a6c7-d0d70b974430 Version: $LATEST
Fatal error: Hoa\Fastcgi\Exception\Exception: Bad request (not a well-formed FastCGI request). in /opt/var/task/app/library/vendor/hoa/fastcgi/Responder.php:239
Stack trace:
#0 /opt/var/task/app/library/vendor/mnapoli/bref/src/Runtime/PhpFpm.php(115): Hoa\Fastcgi\Responder->send(Array, '')
#1 /opt/bootstrap(33): Bref\Runtime\PhpFpm->proxy(Array)
#2 /opt/var/task/app/library/vendor/mnapoli/bref/src/Runtime/LambdaRuntime.php(58): {closure}(Array)
#3 /opt/bootstrap(37): Bref\Runtime\LambdaRuntime->processNextEvent(Object(Closure))
#4 {main}[18-Mar-2019 15:11:20] WARNING: [pool default] child 10 exited on signal 4 (SIGILL) after 0.979374 seconds from start
[18-Mar-2019 15:11:20] NOTICE: [pool default] child 13 started
[18-Mar-2019 15:11:20] NOTICE: Terminating ...
[18-Mar-2019 15:11:20] NOTICE: exiting, bye-bye!
END RequestId: e855a430-023c-4396-a6c7-d0d70b974430
REPORT RequestId: e855a430-023c-4396-a6c7-d0d70b974430	Duration: 247.49 ms	Billed Duration: 300 ms Memory Size: 704 MB	Max Memory Used: 88 MB	
RequestId: e855a430-023c-4396-a6c7-d0d70b974430 Error: Runtime exited with error: exit status 1
Runtime.ExitError
[18-Mar-2019 15:11:21] NOTICE: fpm is running, pid 8
[18-Mar-2019 15:11:21] NOTICE: ready to handle connections
START RequestId: ea9a3a58-64ca-45ed-b082-20e8e55445c1 Version: $LATEST
Fatal error: Hoa\Fastcgi\Exception\Exception: Bad request (not a well-formed FastCGI request). in /opt/var/task/app/library/vendor/hoa/fastcgi/Responder.php:239
Stack trace:
#0 /opt/var/task/app/library/vendor/mnapoli/bref/src/Runtime/PhpFpm.php(115): Hoa\Fastcgi\Responder->send(Array, '')
#1 /opt/bootstrap(33): Bref\Runtime\PhpFpm->proxy(Array)
#2 /opt/var/task/app/library/vendor/mnapoli/bref/src/Runtime/LambdaRuntime.php(58): {closure}(Array)
#3 /opt/bootstrap(37): Bref\Runtime\LambdaRuntime->processNextEvent(Object(Closure))
#4 {main}[18-Mar-2019 15:11:21] NOTICE: Terminating ...
[18-Mar-2019 15:11:21] NOTICE: exiting, bye-bye!
END RequestId: ea9a3a58-64ca-45ed-b082-20e8e55445c1
REPORT RequestId: ea9a3a58-64ca-45ed-b082-20e8e55445c1	Duration: 475.03 ms	Billed Duration: 500 ms Memory Size: 704 MB	Max Memory Used: 81 MB	
RequestId: ea9a3a58-64ca-45ed-b082-20e8e55445c1 Error: Runtime exited with error: exit status 1
Runtime.ExitError

Even when fpm is exited and i get it running with another pid it does not recover… will continue with tests and will update here.

@mnapoli most extensions yes, but i need to have PHP compiled with SOAP support (google ads sdk) and redis compiled with igbinary support also, with this i need to have my own runtime running ( i could only overwrite those files, but i think its easier having everything in a single layer)