[Groonga-commit] droonga/droonga-engine at 19c8eb4 [master] Use "stop_immediately" instead of "shutdown"

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Sep 6 00:19:19 JST 2014


Kouhei Sutou	2014-09-06 00:19:19 +0900 (Sat, 06 Sep 2014)

  New Revision: 19c8eb4ca5b5766d16b93b7de9a794d4cd4753ff
  https://github.com/droonga/droonga-engine/commit/19c8eb4ca5b5766d16b93b7de9a794d4cd4753ff

  Message:
    Use "stop_immediately" instead of "shutdown"
    
    For symmetry of "stop_gracefully".

  Modified files:
    lib/droonga/dispatcher.rb
    lib/droonga/engine.rb
    lib/droonga/farm.rb
    lib/droonga/slice.rb

  Modified: lib/droonga/dispatcher.rb (+3 -3)
===================================================================
--- lib/droonga/dispatcher.rb    2014-09-06 00:11:16 +0900 (6c0eaf0)
+++ lib/droonga/dispatcher.rb    2014-09-06 00:19:19 +0900 (8bbcec6)
@@ -81,8 +81,8 @@ module Droonga
       logger.trace("stop_gracefully: done")
     end
 
-    def shutdown
-      logger.trace("shutdown: start")
+    def stop_immediately
+      logger.trace("stop_immediately: start")
       @collector_runners.each_value do |collector_runner|
         collector_runner.shutdown
       end
@@ -90,7 +90,7 @@ module Droonga
         adapter_runner.shutdown
       end
       @farm.shutdown
-      logger.trace("shutdown: done")
+      logger.trace("stop_immediately: done")
     end
 
     def process_message(message)

  Modified: lib/droonga/engine.rb (+1 -1)
===================================================================
--- lib/droonga/engine.rb    2014-09-06 00:11:16 +0900 (b944e22)
+++ lib/droonga/engine.rb    2014-09-06 00:19:19 +0900 (396d14d)
@@ -80,7 +80,7 @@ module Droonga
       logger.trace("stop_immediately: start")
       output_last_processed_timestamp
       @live_nodes_list_observer.stop
-      @dispatcher.shutdown
+      @dispatcher.stop_immediately
       @state.shutdown
       logger.trace("stop_immediately: done")
     end

  Modified: lib/droonga/farm.rb (+2 -6)
===================================================================
--- lib/droonga/farm.rb    2014-09-06 00:11:16 +0900 (941add7)
+++ lib/droonga/farm.rb    2014-09-06 00:19:19 +0900 (31de0c5)
@@ -62,14 +62,10 @@ module Droonga
       end
     end
 
-    def shutdown
-      threads = []
+    def stop_immediately
       @slices.each_value do |slice|
-        threads << Thread.new do
-          slice.shutdown
-        end
+        slice.stop_immediately
       end
-      threads.each(&:join)
     end
 
     def process(slice_name, message)

  Modified: lib/droonga/slice.rb (+4 -10)
===================================================================
--- lib/droonga/slice.rb    2014-09-06 00:11:16 +0900 (a952f5d)
+++ lib/droonga/slice.rb    2014-09-06 00:19:19 +0900 (d48b328)
@@ -61,12 +61,12 @@ module Droonga
       logger.trace("stop_gracefully: done")
     end
 
-    def shutdown
-      logger.trace("shutdown: start")
-      shutdown_supervisor if @supervisor
+    def stop_immediately
+      logger.trace("stop_immediately: start")
+      @supervisor.stop_immediately if @supervisor
       @job_pusher.shutdown
       @processor.shutdown
-      logger.trace("shutdown: done")
+      logger.trace("stop_immediately: done")
     end
 
     def process(message)
@@ -123,12 +123,6 @@ module Droonga
       @supervisor.start
     end
 
-    def shutdown_supervisor
-      logger.trace("supervisor: shutdown: start")
-      @supervisor.stop_gracefully
-      logger.trace("supervisor: shutdown: done")
-    end
-
     def on_ready
       @on_ready.call if @on_ready
     end
-------------- next part --------------
HTML����������������������������...
Download 



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