lib/ruby_skynet/zookeeper/registry.rb in ruby_skynet-1.2.3 vs lib/ruby_skynet/zookeeper/registry.rb in ruby_skynet-1.2.4
- old
+ new
@@ -390,10 +390,11 @@
# event_hash => {:req_id=>-1, :type=>-1, :state=>-112, :path=>"", :context=>nil}
if @zookeeper && !@zookeeper.closed? && (event_hash[:req_id] == -1) && (event_hash[:state] == ::Zookeeper::ZOO_EXPIRED_SESSION_STATE)
Thread.new do
begin
self.init
- rescue ::Zookeeper::Exceptions::SessionExpired, ::Zookeeper::Exceptions::ConnectionLoss
+ rescue ::Zookeeper::Exceptions::ZookeeperException => exc
+ logger.warn "Failed to reconnect to Zookeeper. Assuming shutdown in progress", exc
# These can occur during a shutdown scenario, hopefully not during
# an actual network or connection loss to the Zookeeper Server
end
end
end
\ No newline at end of file