Commit 3c28bd41 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Call SCRIPT KILL if our Lua script exceeded its allowed run time

parent 5fa637b2
PATH
remote: .
specs:
gitlab-monitor (0.0.19)
gitlab-monitor (0.0.20)
pg (~> 0.18.4)
quantile (~> 0.2.0)
redis-namespace (~> 1.5.2)
......
......@@ -35,9 +35,14 @@ module GitLab
stats = conn.evalsha(QUEUE_JOB_STATS_SHA, ["queue:#{queue.name}"])
job_stats.merge!(stats.to_h)
end
rescue Redis::CommandError # Could happen if the script exceeded the maximum run time (5 seconds by default)
# FIXME: Should we call SCRIPT KILL?
next
rescue Redis::CommandError => e
# Could happen if the script exceeded the maximum run time (5 seconds by default)
next unless e.message.start_with?("BUSY Redis is busy running a script")
Sidekiq.redis do |conn|
conn.script(:kill)
end
return self
end
end
......
module GitLab
module Monitor
VERSION = "0.0.19".freeze
VERSION = "0.0.20".freeze
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment