[Groonga-commit] droonga/droonga-engine at 888e478 [master] Initialize tags without its own on_ready callback

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 13:18:10 JST 2015


YUKI Hiroshi	2015-04-21 13:18:10 +0900 (Tue, 21 Apr 2015)

  New Revision: 888e4789dcbb41c3f9ba8d4d1561aca46f48d31d
  https://github.com/droonga/droonga-engine/commit/888e4789dcbb41c3f9ba8d4d1561aca46f48d31d

  Message:
    Initialize tags without its own on_ready callback

  Modified files:
    lib/droonga/command/droonga_engine.rb
    lib/droonga/serf.rb
    lib/droonga/serf/agent.rb

  Modified: lib/droonga/command/droonga_engine.rb (+1 -0)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2015-04-21 13:02:24 +0900 (62ca2bf)
+++ lib/droonga/command/droonga_engine.rb    2015-04-21 13:18:10 +0900 (c97cda7)
@@ -413,6 +413,7 @@ module Droonga
           start_serf
           @serf_agent.on_ready = lambda do
             logger.trace("run_internal: serf agent is ready")
+            @serf.initialize_tags
             @serf.update_cluster_state
             @service_runner = run_service
             setup_initial_on_ready

  Modified: lib/droonga/serf.rb (+8 -7)
===================================================================
--- lib/droonga/serf.rb    2015-04-21 13:02:24 +0900 (8a41bd3)
+++ lib/droonga/serf.rb    2015-04-21 13:18:10 +0900 (ab13325)
@@ -65,18 +65,19 @@ module Droonga
                         "-event-handler", "droonga-engine-serf-event-handler",
                         "-tags-file", tags_file.to_s,
                         *retry_joins)
-      agent.on_ready = lambda do
-        set_tag("type", "engine")
-        set_tag("cluster_id", cluster_id)
-        current_role = role
-        set_tag("role", current_role)
-        NodeRole.my_role = current_role
-      end
       agent.start
       logger.trace("run_agent: done")
       agent
     end
 
+    def initialize_tags
+      set_tag("type", "engine")
+      set_tag("cluster_id", cluster_id)
+      current_role = role
+      set_tag("role", current_role)
+      NodeRole.my_role = current_role
+    end
+
     def leave
       run_command("leave")
     end

  Modified: lib/droonga/serf/agent.rb (+1 -0)
===================================================================
--- lib/droonga/serf/agent.rb    2015-04-21 13:02:24 +0900 (40d88f8)
+++ lib/droonga/serf/agent.rb    2015-04-21 13:18:10 +0900 (4fe088b)
@@ -196,6 +196,7 @@ module Droonga
         checker = Coolio::TCPSocket.connect(@host, @bind_port)
 
         on_connect = lambda do
+          @serf.initialize_tags
           on_ready
           checker.close
           # logger.trace("start_ready_check: checker watcher detached",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index