fix(docker): hold Lambda extension and exit-watch streams on the streaming pool (#8498)

A Lambda extension's exec and the container's exit watcher each hold a
Docker connection for the container's whole lifetime, and both still ran
on the control-plane client. Enough warm containers, especially with
extensions, could fill that pool and stall every create, start, stop and
remove call, the failure the streaming split was made to prevent.

Both now use the @StreamingDocker client. The exit watcher's inspect is
a short call and stays on the control-plane client, with its retries.
The streaming transport now replays a container wait that fails before
the daemon answers, as the control-plane one does, so a stale socket
does not spend one of the watcher's re-arms. Exec starts and log and
attach streams are still never replayed.

Each live Lambda container now holds its log follow, its exit watcher and
one exec per extension on the streaming pool, so its default rises from
512 to 2048 to cover the 500 containers the runtime API port range allows
with two extensions each. The control-plane default stays at 1024.

Closes #2224
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-15 17:42:28 -04:00
1 parent ec9c19ff62
commit d51af1ecff
19 files changed
+252 -103

No files matched your search

+1 -1
View File
@@ -673,7 +673,7 @@ Configuration resource reads and `ListFunctionsByCodeSigningConfig` return
| `FLOCI_SERVICES_LAMBDA_DURABLE_SWEEP_ENABLED` | `true` | Fire durable execution timers (waits, step retries, execution timeouts, retention expiry) |
| `FLOCI_SERVICES_LAMBDA_DURABLE_SWEEP_INTERVAL_SECONDS` | `1` | How often the durable sweep runs |
| `FLOCI_SERVICES_LAMBDA_RUNTIME_API_BASE_PORT` | `12000` | First port in the Lambda Runtime API range |
| `FLOCI_SERVICES_LAMBDA_RUNTIME_API_MAX_PORT` | `12499` | Last port in the Lambda Runtime API range. One port is held per running container, so the range width caps concurrent executions. Each running container also holds two Docker connections, so a wider range needs a matching `FLOCI_DOCKER_MAX_CONNECTIONS` |
| `FLOCI_SERVICES_LAMBDA_RUNTIME_API_MAX_PORT` | `12499` | Last port in the Lambda Runtime API range. One port is held per running container, so the range width caps concurrent executions. Each running container also holds two streaming Docker connections plus one per extension, so a wider range needs a matching `FLOCI_DOCKER_STREAMING_MAX_CONNECTIONS` |
| `FLOCI_SERVICES_LAMBDA_CODE_PATH` | `./data/lambda-code` | Directory where Lambda ZIP files are stored |
| `FLOCI_SERVICES_LAMBDA_POLL_INTERVAL_MS` | `1000` | Event-source mapping poll interval (milliseconds) |
| `FLOCI_SERVICES_LAMBDA_ASYNC_RETRY_DELAY_SECONDS` | `60` | Wait before the first retry of a failed asynchronous invocation (seconds); the second waits twice this, `0` retries back to back |