[Enhancement]: Allow disabling resource cleanup entirely (no Ryuk, no JVM shutdown hook)

Abierto
#12,195 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, github-actions, java
Área
devops, testing

Línea de trabajo

Start by locating ResourceReaper.instance() and JVMHookResourceReaper, then trace how TESTCONTAINERS_RYUK_DISABLED and testcontainers.properties values are loaded. Identify the existing tests for resource-reaper selection and add coverage for a no-op mode. The work is done when a supported configuration can disable both Ryuk and the JVM shutdown hook while preserving the existing cleanup modes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

type/enhancement
Module

Core

Proposal
Problem

On ephemeral CI runners, Testcontainers' resource cleanup is unnecessary: the whole VM is discarded when the job ends. Setting TESTCONTAINERS_RYUK_DISABLED=true does not turn cleanup off; it switches ResourceReaper.instance() to JVMHookResourceReaper, which on JVM shutdown runs label-filtered docker {network,volume,image} prune calls.

We ran into an issue when upgrading our GitHub Actions runners to Ubuntu 26.04 with Docker 29 and the containerd image store. Our backend build failed in ~36% of runs with image-pull errors like:

failed commit on ref ... no such file or directory

Our hypothesis is moby/moby#53321: an image prune on the containerd store can drop leases of in-progress pulls, even pulls of images that don't match the prune's label filter. So each test JVM exiting can break pulls of other JVMs still running. After re-enabling Ryuk (which removes images individually via ImageRemove, not via prune, the problem disappeared.

Discussion #12085 ("unknown blob" errors with parallel builds) may be related, but its setup differs and there's no confirmed link.

Proposal

Provide a supported way to skip cleanup completely, e.g. an environment variable / testcontainers.properties entry such as TESTCONTAINERS_RESOURCE_REAPER=none (alongside the implicit ryuk / jvm-hook), selecting a no-op ResourceReaper.

Benefit

Ephemeral CI avoids the Ryuk container and its startup cost without falling back to the shutdown-hook prune.

Lenguaje dominante
Java
Estrellas
8.8k
Forks
2k
Merge medio
2 d 1 h
PR fusionados (30 d)
11

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de testcontainers/testcontainers-java

Todos los issues de testcontainers/testcontainers-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.