Skip to contents

Stops + removes the container at index idx if it exists, then starts a fresh replacement with identical config (image, scratch_root bind-mount, user, cpu_limit, mem_limit) under the same container name.

Usage

landis_pool_restart_one(pool, idx)

Arguments

pool

A landis_pool object from landis_pool_start().

idx

Integer. 1-based index of the container to replace.

Value

The pool (invisibly, unchanged – $names[idx] still names the container, which is now a freshly started one).

Details

Reusing the name is deliberate: landis_pool is a plain list, so a rename could not be propagated back to whichever frame owns the pool, and that owner would go on addressing a container that no longer exists. A stable name also keeps the container name usable as a cross-process mutex.

Intended for use by landis_pool_exec()'s retries mechanism, but also safe to call directly when a calibration driver detects a container is wedged or has been OOM-killed.