Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeebeVolumes are not cleaned up by Ryuk #656

Closed
lenaschoenburg opened this issue Mar 1, 2024 · 0 comments · Fixed by #660
Closed

ZeebeVolumes are not cleaned up by Ryuk #656

lenaschoenburg opened this issue Mar 1, 2024 · 0 comments · Fixed by #660
Labels
type/bug Something isn't working

Comments

@lenaschoenburg
Copy link
Contributor

lenaschoenburg commented Mar 1, 2024

While debugging some disk usage issues in camunda/camunda#16619, I've noticed thousands of leaked volumes that did not get cleaned up by Ryuk.

The ZeebeVolume does apply some labels that are supposed to mark it for Ryuk:

final CreateVolumeResponse response =
configurator.apply(command.withLabels(DockerClientFactory.DEFAULT_LABELS)).exec();

These default labels look like this:

However, testcontainers-java sends Ryuk the following labels:
https://github.com/testcontainers/testcontainers-java/blob/33c904ed9c23088d725dd0b5f017cdab2384edae/core/src/main/java/org/testcontainers/utility/ResourceReaper.java#L44-L56

As you can see, the TESTCONTAINERS_SESSION_ID_LABEL is missing from the ZeebeVolume labels.
And indeed, if I modify the volume with, they get cleaned up by Ryuk as expected.

ZeebeVolume.newVolume(
    cfg -> {
      final var labels = new HashMap<>(cfg.getLabels());
      labels.put(
          DockerClientFactory.TESTCONTAINERS_SESSION_ID_LABEL,
          DockerClientFactory.SESSION_ID);
      return cfg.withLabels(labels);
    });
@lenaschoenburg lenaschoenburg added the type/bug Something isn't working label Mar 1, 2024
lenaschoenburg added a commit to lenaschoenburg/zeebe-test-container that referenced this issue Mar 8, 2024
Adds the labels required for Ryuk (and other cleanup mechanisms) to pick up
volumes and clean them up, similar to containers and networks.

Closes camunda-community-hub#656
lenaschoenburg added a commit to lenaschoenburg/zeebe-test-container that referenced this issue Mar 8, 2024
Adds the labels required for Ryuk (and other cleanup mechanisms) to pick up
volumes and clean them up, similar to containers and networks.

Closes camunda-community-hub#656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant