[Groonga-commit] droonga/fluent-plugin-droonga at 8ee807a [master] Fix a problem that duplicated socket path for job queue on restart

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Apr 11 12:46:34 JST 2014


Kouhei Sutou	2014-04-11 12:46:34 +0900 (Fri, 11 Apr 2014)

  New Revision: 8ee807a07187a6160201cab6e1f33aa08bc255cf
  https://github.com/droonga/fluent-plugin-droonga/commit/8ee807a07187a6160201cab6e1f33aa08bc255cf

  Message:
    Fix a problem that duplicated socket path for job queue on restart
    
    Here is a problem case:
    
      * Start f-p-d:
        * Create a new JobQueue.
        * The JobQueue creates #{DB_PATH}.sock.
        * Create workers.
        * Workers connect to #{DB_PATH}.sock.
      * `touch catalog.json`.
      * Start new dispatcher.
        * Create a new JobQueue.
        * The JobQueue removes existing #{DB_PATH}.sock and
          creates #{DB_PATH}.sock.
        * Create workers... (async. continue...)
      * Stop old dispatcher.
        * Stop its JobQueue.
        * The JobQueue removes #{DB_PATH}.sock.
      * Created workers. (cont.)
        * Workers connect to #{DB_PATH}.sock but #{DB_PATH}.sock doesn't exist!

  Modified files:
    lib/droonga/job_pusher.rb

  Modified: lib/droonga/job_pusher.rb (+1 -1)
===================================================================
--- lib/droonga/job_pusher.rb    2014-04-11 12:32:07 +0900 (c65a1af)
+++ lib/droonga/job_pusher.rb    2014-04-11 12:46:34 +0900 (74723b4)
@@ -25,7 +25,7 @@ module Droonga
     attr_reader :socket_path
     def initialize(loop, base_path)
       @loop = loop
-      @socket_path = "#{base_path}.sock"
+      @socket_path = "#{base_path}.#{Process.pid}.#{object_id}.sock"
       @job_queue = JobQueue.new(@loop)
     end
 
-------------- next part --------------
HTML����������������������������...
Download 



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