fix(docker): dispose owned clients with their CDI beans (#7267)

Close control-plane and streaming Docker clients through qualifier-matched CDI disposers. Verify generated bean destruction releases its owned idle eviction thread while preserving another client pool. Close direct producer fixtures.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-11-02 07:04:46 -04:00
1 parent 23a8dbb198
commit 699d472f20
3 files changed
+95 -8

No files matched your search

@@ -12,6 +12,7 @@ import com.github.dockerjava.transport.DockerHttpClient;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.core.common.Digests;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Disposes;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
@@ -450,6 +451,14 @@ public class DockerClientProducer {
validateStreamingMaxConnections(config.docker().streamingMaxConnections()), "streaming");
}
void disposeDockerClient(@Disposes DockerClient client) throws IOException {
client.close();
}
void disposeStreamingDockerClient(@Disposes @StreamingDocker DockerClient client) throws IOException {
client.close();
}
/**
* Builds the {@link DefaultDockerClientConfig} shared by both DockerClient beans (host and
* Docker-context resolution, optional Docker config path, and any TLS material the active