diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-09 10:29:39 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-09 10:29:39 +0300 |
commit | 04a66a8d7c94f2294982458ba6442d3658078f88 (patch) | |
tree | 68bcd990433db5c9d8fadf48a5258535574fc8e9 /lib | |
parent | d2a6a1623e8a808a14f4ab8f4f1dc07ccb944443 (diff) | |
download | gitlab-ci-04a66a8d7c94f2294982458ba6442d3658078f88.tar.gz |
Correctly hanlde build timeouts
Diffstat (limited to 'lib')
-rw-r--r-- | lib/runner.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/runner.rb b/lib/runner.rb index c7205b7..59e0375 100644 --- a/lib/runner.rb +++ b/lib/runner.rb @@ -1,6 +1,3 @@ -require 'open3' -require 'timeout' - class Runner include Sidekiq::Worker @@ -52,13 +49,6 @@ class Runner end build.success! - rescue Errno::ENOENT => ex - - @output << "INVALID PROJECT PATH" - build.drop! - rescue Timeout::Error - @output << "TIMEOUT" - build.drop! ensure build.write_trace(@output) end @@ -97,7 +87,9 @@ class Runner begin @process.poll_for_exit(project.timeout) rescue ChildProcess::TimeoutError + @output << "TIMEOUT" @process.stop # tries increasingly harsher methods to kill the process. + return false end @process.exit_code == 0 |