updated container handling. hopefully removed potential error source.

This commit is contained in:
Ralf Teusner
2015-04-22 15:00:01 +02:00
parent a7087824b1
commit e515afe619
2 changed files with 28 additions and 4 deletions

View File

@@ -188,7 +188,17 @@ class DockerClient
{status: :ok, stderr: stderr.join, stdout: stdout.join}
end
rescue Timeout::Error
container.restart if RECYCLE_CONTAINERS
#container.restart if RECYCLE_CONTAINERS
DockerContainerPool.remove_from_all_containers(container, @execution_environment)
# destroy container
destroy_container(container)
if(RECYCLE_CONTAINERS)
# create new container and add it to @all_containers. will be added to @containers on return_container
container = create_container(execution_environment)
DockerContainerPool.add_to_all_containers(container, execution_environment)
end
{status: :timeout}
ensure
RECYCLE_CONTAINERS ? return_container(container) : self.class.destroy_container(container)