mirror of
https://github.com/floci-io/floci.git
synced 2026-12-03 02:07:58 -05:00
fix(lambda): remove containers orphaned by previous runs (#7734)
Label runtime and code-copy containers with protected deployment and run identities. Reconcile previous runs at Docker startup and retry incomplete cleanup on cold starts, preserving current environments and named volumes. Honor the Lambda reconciliation switch at startup and before cold starts. Share the owned-container sweep with ECS, retaining each service run policy and reporting persistent failures once until recovery.
This commit is contained in:
1 parent
6130fe9568
commit
6be18ea1ee
15 files changed
+680
-51
No files matched your search
@@ -614,6 +614,7 @@ Configuration resource reads and `ListFunctionsByCodeSigningConfig` return
|
||||
|---|---|---|
|
||||
| `FLOCI_SERVICES_LAMBDA_ENABLED` | `true` | Enable or disable the service |
|
||||
| `FLOCI_SERVICES_LAMBDA_EPHEMERAL` | `false` | Remove containers after each invocation |
|
||||
| `FLOCI_SERVICES_LAMBDA_RECONCILE_CONTAINERS_ON_STARTUP` | `true` | Reclaim owned Docker containers from previous runs at startup and retry incomplete cleanup on cold starts; disable when deployments share the same owner identity |
|
||||
| `FLOCI_SERVICES_LAMBDA_HONOUR_ARCHITECTURES` | `false` | Select each function's declared architecture for Docker image pulls and containers |
|
||||
| `FLOCI_SERVICES_LAMBDA_DEFAULT_MEMORY_MB` | `128` | Default function memory (MB) |
|
||||
| `FLOCI_SERVICES_LAMBDA_DEFAULT_TIMEOUT_SECONDS` | `3` | Default function timeout (seconds) |
|
||||
@@ -682,6 +683,21 @@ Configuration resource reads and `ListFunctionsByCodeSigningConfig` return
|
||||
finishes or fails. It runs no Lambda code; actual execution environments retain
|
||||
their normal shutdown and extension-drain behavior.
|
||||
|
||||
!!! note "Cleanup after an unclean Docker shutdown"
|
||||
At startup, Floci removes running and exited Lambda containers left by a previous run,
|
||||
including temporary code-copy helpers. Cleanup is scoped to the Docker resource namespace
|
||||
and Floci API port, and preserves containers from the current run and named code volumes.
|
||||
If Docker is unavailable or removal fails, the next cold start retries cleanup.
|
||||
|
||||
This applies to containers created with ownership and run labels. Containers from older
|
||||
versions without those labels are left alone because their deployment cannot be identified
|
||||
safely. Use distinct `FLOCI_DOCKER_RESOURCE_NAMESPACE` values for deployments sharing a daemon.
|
||||
|
||||
If two deployments must share the same namespace and API port, set
|
||||
`FLOCI_SERVICES_LAMBDA_RECONCILE_CONTAINERS_ON_STARTUP=false` to disable both startup cleanup
|
||||
and cold-start retries. Cleanup is enabled by default. Each distinct Docker listing or removal
|
||||
failure warns once; repeated failures log at DEBUG until cleanup recovers.
|
||||
|
||||
!!! note "Bounding warm containers"
|
||||
After an invocation the container stays warm so the next call skips the cold start, and is
|
||||
reaped only after `container-idle-timeout-seconds` of inactivity. Each function keeps up to
|
||||
|
||||
Reference in new issue
Block a user