Added some logs

This commit is contained in:
Jan Renz
2015-04-23 09:54:30 +02:00
parent edbf74b4b9
commit 431b18b526
2 changed files with 13 additions and 2 deletions

View File

@ -80,6 +80,7 @@ class DockerClient
private :create_workspace_file
def self.destroy_container(container)
Rails.logger.info('destroying container ' + container.to_s)
container.stop.kill
container.port_bindings.values.each { |port| PortPool.release(port) }
FileUtils.rm_rf(local_workspace_path(container)) if local_workspace_path(container)
@ -188,6 +189,7 @@ class DockerClient
{status: :ok, stderr: stderr.join, stdout: stdout.join}
end
rescue Timeout::Error
Rails.logger.info('got timeout error for container ' + container.to_s)
#container.restart if RECYCLE_CONTAINERS
DockerContainerPool.remove_from_all_containers(container, @execution_environment)
@ -201,6 +203,7 @@ class DockerClient
end
{status: :timeout}
ensure
Rails.logger.info('after timeout error ensuring for' + container.to_s)
RECYCLE_CONTAINERS ? return_container(container) : self.class.destroy_container(container)
end
private :send_command