lib/zk/fork_hook.rb in zk-1.5.1 vs lib/zk/fork_hook.rb in zk-1.5.2
- old
+ new
@@ -16,9 +16,12 @@
# @private
def fire_prepare_hooks!
@mutex.lock
logger.debug { "#{__method__}" }
safe_call(@hooks[:prepare])
+ rescue Exception => e
+ @mutex.unlock rescue nil # if something goes wrong in a hook, then release the lock
+ raise e
end
# @private
def fire_after_child_hooks!
@mutex.unlock rescue nil