You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build a system with reactphp/http and reactphp/async to do http calls in parallel in cascade.
🚀 Locally in docker working perfectly.
🎁 When deploying on AWS Lambda (Lambda as a Docker Image) via serverless deploy, surprise:
RequestId: 5ad1b639-980b-4f3c-baf6-7ac7d40971ee Error: Runtime exited with error: exit status 141
Runtime.ExitError
I manage to fix it with:
// Try to handle SIGPIPE and other potential signals gracefully\pcntl_async_signals(true);
\pcntl_signal(SIGPIPE, function() {
echo'Caught SIGPIPE, closing socket.' . PHP_EOL; // Remove this line in prod
});
With \pcntl_async_signals(true);, you enable asynchronous signal handling for your program, allowing it to catch and handle signals.
With the \pcntl_signal(SIGPIPE, ...), you specify a handler function for SIGPIPE.
While it fixes my little PoC. It is not fixing the whole project.
But it feels like a hack. I like it could crash anytime since
AWS Lambda does not provide full support for handling Unix signals as it abstracts many of these lower-level system interactions, which might lead to unexpected behavior or inability to handle signals properly.
I saw you have implemented several EventLoop type of implementation. Did I miss something ?
The bref lambda layer has [pcntl](https://www.php.net/manual/en/book.pcntl.php) by default.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
👏 Thanks for the incredible work.
I tried to build a system with reactphp/http and reactphp/async to do http calls in parallel in cascade.
🚀 Locally in docker working perfectly.
🎁 When deploying on AWS Lambda (Lambda as a Docker Image) via
serverless deploy
, surprise:I manage to fix it with:
While it fixes my little PoC. It is not fixing the whole project.
But it feels like a hack. I like it could crash anytime since
I saw you have implemented several EventLoop type of implementation. Did I miss something ?
The bref lambda layer has
[pcntl](https://www.php.net/manual/en/book.pcntl.php)
by default.Thanks in advance
Have a great day
Beta Was this translation helpful? Give feedback.
All reactions