mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(lambdaweb): never run a request twice when the app crashes (#5842)
* fix(lambdaweb): retry a failed request only when Floci saw the exit before sending it A request that found its environment dead was retried when Docker's exit time came before the request start. Docker takes that time from the daemon's clock, which can be seconds behind Floci's. So a request the app had received could run a second time. Docker also reports an exit late under load. Until then the dead environment stayed in the pool, and the next request got a 503 too. Floci now follows each environment with an attach stream. The stream ends when the process exits, and Floci notes the time on its own clock. A failed request waits for that, up to one second. It is retried only if the exit came before it was sent. Otherwise it gets the 503 page after the dead environment has left the pool. * docs(lambdaweb): note the short window after an exit in the 503 row * fix(lambdaweb): clean up an exited environment off the reaper thread Docker can take seconds to report an exit status under load. On the reaper this held up the rearm of dropped exit watches and the idle checks. * test(lambdaweb): wait for Floci to see the exit instead of polling for the container
This commit is contained in:
1 parent
7cab804d22
commit
c8de16ffc7
5 files changed
+143
-48
No files matched your search
@@ -84,7 +84,7 @@ The platform answers these cases itself, with the AWS HTML pages and `lambda-web
|
||||
| 429 | `Platform.EndpointRequestThrottle` | The requests exceed the endpoint's `rateLimit` |
|
||||
| 502 | `Application.TimeoutListenError`, `Application.InitCodeError`, `Runtime.Exit` | The server did not listen within 10 seconds, threw at import, or exited at start |
|
||||
| 503 | `Platform.EndpointDisabled` | The endpoint's `rateLimit` is 0 |
|
||||
| 503 | `Runtime.OriginRequestError` | The process died while handling the request |
|
||||
| 503 | `Runtime.OriginRequestError` | The process died while handling the request, or tens of milliseconds before it |
|
||||
| 504 | `Runtime.RequestTimeout` | No response within the revision's `timeoutSeconds` |
|
||||
| 505 | `Platform.UnsupportedHttpVersion` | HTTP/1.0 |
|
||||
|
||||
|
||||
Reference in new issue
Block a user