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

オープン
#12,195 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, github-actions, java
領域
devops, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Java
スター
8.8k
フォーク
2k
平均マージ
2日 1時間
マージ済み PR(30日)
11

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

testcontainers/testcontainers-java のほかの issue

testcontainers/testcontainers-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。