diff --git a/ruby/lib/ci/queue/redis.rb b/ruby/lib/ci/queue/redis.rb index 526c4aed..5c17e253 100644 --- a/ruby/lib/ci/queue/redis.rb +++ b/ruby/lib/ci/queue/redis.rb @@ -16,6 +16,7 @@ module Queue module Redis Error = Class.new(StandardError) LostMaster = Class.new(Error) + ReservationError = Class.new(Error) class << self diff --git a/ruby/lib/ci/queue/redis/worker.rb b/ruby/lib/ci/queue/redis/worker.rb index ff87b6e0..00013b5d 100644 --- a/ruby/lib/ci/queue/redis/worker.rb +++ b/ruby/lib/ci/queue/redis/worker.rb @@ -5,8 +5,6 @@ module CI module Queue module Redis - ReservationError = Class.new(StandardError) - class << self attr_accessor :requeue_offset end diff --git a/ruby/lib/minitest/queue.rb b/ruby/lib/minitest/queue.rb index af127e82..ef71c43f 100644 --- a/ruby/lib/minitest/queue.rb +++ b/ruby/lib/minitest/queue.rb @@ -266,6 +266,13 @@ def run_from_queue(reporter, *) reopen_previous_step puts red("The heartbeat process died. This worker is exiting early.") exit!(41) + rescue CI::Queue::Redis::Error + reopen_previous_step + puts red("#{error.class}: #{error.message}") + error.backtrace.each do |frame| + puts red(frame) + end + exit!(41) rescue => error reopen_previous_step queue.report_worker_error(error)