[Groonga-commit] droonga/fluent-plugin-droonga at c967af9 [master] Disable GC while touching Groonga objects to avoid crash :<

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Mar 27 23:12:31 JST 2014


Kouhei Sutou	2014-03-27 23:12:31 +0900 (Thu, 27 Mar 2014)

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

  Message:
    Disable GC while touching Groonga objects to avoid crash :<
    
    This is just a workaround. We should remove it ASAP!!!

  Modified files:
    lib/droonga/searcher.rb

  Modified: lib/droonga/searcher.rb (+14 -2)
===================================================================
--- lib/droonga/searcher.rb    2014-03-27 13:03:03 +0900 (9205df6)
+++ lib/droonga/searcher.rb    2014-03-27 23:12:31 +0900 (306ed45)
@@ -61,14 +61,26 @@ module Droonga
     def search(queries)
       outputs = nil
       logger.trace("search: start", :queries => queries)
-      @context.push_memory_pool do
-        outputs = process_queries(queries)
+      # TODO: THIS IS JUST A WORKAROUND! We should remove it ASAP!
+      disable_gc do
+        @context.push_memory_pool do
+          outputs = process_queries(queries)
+        end
       end
       logger.trace("search: done")
       return outputs
     end
 
     private
+    def disable_gc
+      GC.disable
+      begin
+        yield
+      ensure
+        GC.enable
+      end
+    end
+
     def process_queries(queries)
       logger.trace("process_queries: start")
       if queries.nil? or queries.empty?
-------------- next part --------------
HTML����������������������������...
Download 



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