Subject: | Request terminated with 504 even though it's not a timeout |
Date: | Wed, 14 Oct 2020 14:09:17 -0500 |
To: | bug-Plack-Middleware-Timeout [...] rt.cpan.org |
From: | Damian Nowak <spam [...] nowaker.net> |
When the underlying code during request handling exits with an error,
Plack::Middleware::Timeout catches it and treats it as if it was a timeout,
and responds with 504.
This should not happen. Plack::Middleware::Timeout should only trigger its
response handling if the timeout has been *actually* reached.
Any errors in the underlying code should be passed untouched to middlewares
before Plack::Middleware::Timeout for handling, like
Plack::Middleware::Stacktrace or Plack::Middleware::Sentry.
Result without Plack::Middleware::Timeout:
Can't call method "XXX" on an undefined value at /YYY.pm line ZZZ
(provided by Plack::Middleware::StackTrace)
Result with Plack::Middleware::Timeout: HTTP ERROR 504
Expected result with Plack::Middleware::Timeout:
Can't call method "XXX" on an undefined value at /YYY.pm line ZZZ
(Plack::Middleware::Timeout to ignore the error, as no timeout has occurred)