mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
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:
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
|
||||
|
||||
Reference in new issue
Block a user