lib/celluloid/supervisor.rb in celluloid-0.6.0 vs lib/celluloid/supervisor.rb in celluloid-0.6.1
- old
+ new
@@ -24,14 +24,19 @@
def start_actor(start_attempts = 2, sleep_interval = 30)
failures = 0
begin
@actor = @klass.new_link(*@args, &@block)
- rescue
+ rescue => ex
failures += 1
if failures >= start_attempts
failures = 0
- Celluloid.logger.warn "#{@klass} is crashing on initialize repeatedly, sleeping for #{sleep_interval} seconds"
+
+ warning = "#{@klass} is crashing on initialize repeatedly, sleeping for #{sleep_interval} seconds\n"
+ warning << "#{ex.class}: #{ex}\n "
+ warning << "#{ex.backtrace.join("\n ")}"
+
+ Celluloid.logger.warn warning if Celluloid.logger
sleep sleep_interval
end
retry
end