diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a24156..c91fec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## HEAD +## 4.0.12 + +- Fix deadlock when a single process kills the same app twice (https://github.com/heroku/hatchet/pull/63) +- Add ability to debug deadlock with HATCHET_DEBUG_DEADLOCK env var. + +## 4.0.11 + - Fix logic in rake task (https://github.com/heroku/hatchet/pull/62) ## 4.0.10 diff --git a/lib/hatchet.rb b/lib/hatchet.rb index 98e40d3..892c529 100644 --- a/lib/hatchet.rb +++ b/lib/hatchet.rb @@ -31,4 +31,13 @@ def self.git_branch raise "Attempting to find current branch name. Error: Cannot describe git: #{out}" unless $?.success? out end -end \ No newline at end of file + + if ENV["HATCHET_DEBUG_DEADLOCK"] + Thread.new do + loop do + sleep ENV["HATCHET_DEBUG_DEADLOCK"].to_f # seconds + Thread.list.each { |t| puts "=" * 80; puts t.backtrace } + end + end + end +end diff --git a/lib/hatchet/reaper.rb b/lib/hatchet/reaper.rb index 1c678e5..d3fd483 100644 --- a/lib/hatchet/reaper.rb +++ b/lib/hatchet/reaper.rb @@ -52,6 +52,7 @@ def cycle body = e.response.body if body =~ /Couldn\'t find that app./ puts "#{@message}, but looks like it was already deleted" + mutex.close # ensure only gets called on block exit and not on `retry` retry end raise e diff --git a/lib/hatchet/version.rb b/lib/hatchet/version.rb index 9adec30..627b13e 100644 --- a/lib/hatchet/version.rb +++ b/lib/hatchet/version.rb @@ -1,3 +1,3 @@ module Hatchet - VERSION = "4.0.11" + VERSION = "4.0.12" end