From f88e77f0bd744e86a18eb43625305680f1734ad8 Mon Sep 17 00:00:00 2001 From: Anson Qian Date: Fri, 14 Jun 2019 09:19:36 -0700 Subject: [PATCH] Remove on_connected to avoid reconnect storm (#294) --- Gemfile.lock | 2 +- lib/synapse/service_watcher/zookeeper.rb | 13 ------------- lib/synapse/version.rb | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a1c3d353..920d24b9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - synapse (0.16.9) + synapse (0.16.10) aws-sdk (~> 1.39) docker-api (~> 1.7) dogstatsd-ruby (~> 3.3.0) diff --git a/lib/synapse/service_watcher/zookeeper.rb b/lib/synapse/service_watcher/zookeeper.rb index ddd4a925..3be450d7 100644 --- a/lib/synapse/service_watcher/zookeeper.rb +++ b/lib/synapse/service_watcher/zookeeper.rb @@ -359,19 +359,6 @@ def zk_connect zk_cleanup end - # handle session connected after reconnecting - # http://zookeeper.apache.org/doc/r3.3.5/zookeeperProgrammers.html#ch_zkSessions - @zk.on_connected do - log.info "synapse: ZK client has reconnected #{@name}" - # random backoff to avoid refresh at the same time - sleep rand(10) - # zookeeper watcher is one-time trigger, and can be lost when disconnected - # https://zookeeper.apache.org/doc/r3.3.5/zookeeperProgrammers.html#ch_zkWatches - @watcher.unsubscribe unless @watcher.nil? - @watcher = nil - watcher_callback.call - end - # the path must exist, otherwise watch callbacks will not work statsd_time('synapse.watcher.zk.create_path.elapsed_time', ["zk_cluster:#{@zk_cluster}", "service_name:#{@name}"]) do create(@discovery['path']) diff --git a/lib/synapse/version.rb b/lib/synapse/version.rb index 16e3fdef..a074a49f 100644 --- a/lib/synapse/version.rb +++ b/lib/synapse/version.rb @@ -1,3 +1,3 @@ module Synapse - VERSION = "0.16.9" + VERSION = "0.16.10" end