Permalink
Browse files

If undeploy fails, jstack!

  • Loading branch information...
bobmcwhirter committed Aug 29, 2011
1 parent 823408d commit c730e9892eaf9e2490b651b32ebc856b4af74abb
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/torquespec/server.rb
View
@@ -45,7 +45,12 @@ def deploy(url)
end
def undeploy(url)
- _undeploy(url)
+ begin
+ _undeploy(url)
+ rescue Exception=>e
+ $stderr.puts `jstack #{self.server_pid}`
+ raise e
+ end
end
def wait_for_ready(timeout)
@@ -67,6 +72,7 @@ def startup(opts)
wait = opts[:wait].to_i
cmd = start_command
process = IO.popen( cmd )
+ self.server_pid = process.pid
Thread.new(process) { |console| while(console.gets); end }
%w{ INT TERM KILL }.each { |signal| trap(signal) { stop } }
puts "#{cmd}\npid=#{process.pid}"
@@ -96,6 +102,7 @@ def http req
end
attr_accessor :stopped
+ attr_accessor :server_pid
end
end

0 comments on commit c730e98

Please sign in to comment.