Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schneems/debug deadlock #63

Merged
merged 3 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 10 additions & 1 deletion lib/hatchet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

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
1 change: 1 addition & 0 deletions lib/hatchet/reaper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/hatchet/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Hatchet
VERSION = "4.0.11"
VERSION = "4.0.12"
end