From 6124401dd5c9fcdc4a50a3c1af83e4c61a3a400e Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Tue, 10 Dec 2024 10:39:52 +0000 Subject: [PATCH] Ignore ci-queue errors --- ruby/lib/ci/queue/redis.rb | 1 + ruby/lib/ci/queue/redis/worker.rb | 2 -- ruby/lib/minitest/queue.rb | 7 +++++++ 3 files changed, 8 insertions(+), 2 deletions(-) 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)