bref icon indicating copy to clipboard operation
bref copied to clipboard

feat: Allow configurable timeout via environment variable

Open ttsuru opened this issue 9 months ago • 3 comments

  • The timeout value (in microseconds) is now configurable using the BREF_FPM_READY_TIMEOUT environment variable.
  • If the BREF_FPM_READY_TIMEOUT variable is not set, the default timeout is 5 seconds (5000000 microseconds).

ref: #1917

ttsuru avatar Mar 12 '25 04:03 ttsuru

Any chance of this being picked up?

We need this because we are running into this a lot.

28138e2b-4095-4356-be3e-03c840b2d600	Invoke Error	{
    "errorType": "Bref\\Event\\Http\\FastCgi\\Timeout",
    "errorMessage": "The request 28138e2b-4095-4356-be3e-03c840b2d600 timed out after 2000 ms. Note: that duration may be lower than the Lambda timeout, don't be surprised, that is intentional. Indeed, Bref stops the PHP-FPM request *before* a hard Lambda timeout, because a hard timeout prevents all logs to be written to CloudWatch.",
    "stack": [
        "#0 /var/task/vendor/bref/bref/src/Event/Http/HttpHandler.php(25): Bref\\Event\\Http\\FpmHandler->handleRequest()",
        "#1 /var/task/vendor/bref/bref/src/Runtime/Invoker.php(29): Bref\\Event\\Http\\HttpHandler->handle()",
        "#2 /var/task/vendor/bref/bref/src/Runtime/LambdaRuntime.php(91): Bref\\Runtime\\Invoker->invoke()",
        "#3 /var/runtime/bootstrap(55): Bref\\Runtime\\LambdaRuntime->processNextEvent()",
        "#4 {main}"
    ]
}

In our case the upstream HTTP POST can take around 3-4 seconds and a hard stop of 2 seconds (the lambda is 10 seconds) is causing false alerts on our monitoring,

Cheers, Indy

indy-singh avatar Mar 18 '25 13:03 indy-singh

Hey, sorry for the delay. I will review this but not this week unfortunately, this is a launch week + I'm moving to a conference talk so only focusing on urgent bugfixes. But I'll get back to this ASAP 👍

mnapoli avatar Mar 19 '25 09:03 mnapoli

@mnapoli Any update on this?

indy-singh avatar Jun 09 '25 14:06 indy-singh