From 1966a6e6a61124f3e7e3e72457c451498f4bd8c1 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sun, 22 Mar 2020 10:42:04 +0100 Subject: [PATCH] Add comment for usage of the new semaphore in the DockerClient --- lib/docker_container_pool.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/docker_container_pool.rb b/lib/docker_container_pool.rb index b2f893bb..c71b49e3 100644 --- a/lib/docker_container_pool.rb +++ b/lib/docker_container_pool.rb @@ -9,6 +9,7 @@ class DockerContainerPool # From there, it was added to `remove_from_all_containers` and `add_to_all_containers` first. That ensures, replacing is atomic. # When `replace_broken_container` was extended to check the total amount of containers first, the `bypass_semaphore` flag was also added to `get_container` and # back to `replace_broken_container`. When the semaphore is not released, no container operations can be done! + # Furthermore, the semaphore is used when killing a container in the DockerClient. @semaphore = Concurrent::Semaphore.new(1) @containers = Concurrent::Hash[ExecutionEnvironment.all.map { |execution_environment| [execution_environment.id, Concurrent::Array.new] }]