[Groonga-commit] droonga/droonga-engine at cfe881e [master] Suppress error while failed to run serf event handler.

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Dec 16 19:27:30 JST 2014


YUKI Hiroshi	2014-12-16 19:27:30 +0900 (Tue, 16 Dec 2014)

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

  Message:
    Suppress error while failed to run serf event handler.
    
    The error is:
    message/error/missing-dataset.test: 2014-12-16T10:09:33+00:00[6290][error]: serf[6295]: agent: Error invoking script 'droonga-engine-serf-event-handler': exit status 1
    SUCCESS
    
    It appears when there is globally installed droonga-engine and we are running tests in a local repository.
    (Serf tries to start glbally installed droonga-engine-serf-event-handler command and it tries to touch files under ~droonga-engine even if the current user is not the user, then it fails with "permission denied" error.)

  Modified files:
    lib/droonga/command/serf_event_handler.rb

  Modified: lib/droonga/command/serf_event_handler.rb (+9 -4)
===================================================================
--- lib/droonga/command/serf_event_handler.rb    2014-12-16 16:50:03 +0900 (0d99a6f)
+++ lib/droonga/command/serf_event_handler.rb    2014-12-16 19:27:30 +0900 (989fc29)
@@ -43,10 +43,15 @@ module Droonga
       rescue Exception => exception
         #XXX Any exception blocks following serf operations.
         #    To keep it working, I rescue any exception for now.
-        FileUtils.mkdir_p(Path.serf_event_handler_errors)
-        File.open(Path.serf_event_handler_error_file, "w") do |file|
-          file.write(exception.inspect)
-          file.write(exception.backtrace)
+        begin
+          FileUtils.mkdir_p(Path.serf_event_handler_errors)
+          File.open(Path.serf_event_handler_error_file, "w") do |file|
+            file.write(exception.inspect)
+            file.write(exception.backtrace)
+          end
+        rescue Errno::EACCES => permission_denied_exception
+          puts exception.inspect
+          puts exception.backtrace
         end
         true
       end
-------------- next part --------------
HTML����������������������������...
다운로드 



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