You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/05/17 13:41:13 UTC

svn commit: r1104168 - /couchdb/trunk/src/couchdb/couch_ref_counter.erl

Author: fdmanana
Date: Tue May 17 11:41:12 2011
New Revision: 1104168

URL: http://svn.apache.org/viewvc?rev=1104168&view=rev
Log:
Add infinity timeout to couch_ref_counter calls

After compacting a very large database, the updater calls the couch_db gen_server with
a db record that contains a new ref counter. The couch_db gen_server calls drop on the
old ref counter and calls add on the new ref counter. However since the system is busy
deleting the old db file or garbage collecting, one of the ref counter calls times out,
causing couch_db's terminate to invoked and terminate calls shutdown on the updater.
However the updater is waiting for the call it made to couch_db to complete, which can't
complete since it's waiting for the updater.


Modified:
    couchdb/trunk/src/couchdb/couch_ref_counter.erl

Modified: couchdb/trunk/src/couchdb/couch_ref_counter.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_ref_counter.erl?rev=1104168&r1=1104167&r2=1104168&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_ref_counter.erl (original)
+++ couchdb/trunk/src/couchdb/couch_ref_counter.erl Tue May 17 11:41:12 2011
@@ -24,14 +24,14 @@ drop(RefCounterPid) ->
     drop(RefCounterPid, self()).
 
 drop(RefCounterPid, Pid) ->
-    gen_server:call(RefCounterPid, {drop, Pid}).
+    gen_server:call(RefCounterPid, {drop, Pid}, infinity).
 
 
 add(RefCounterPid) ->
     add(RefCounterPid, self()).
 
 add(RefCounterPid, Pid) ->
-    gen_server:call(RefCounterPid, {add, Pid}).
+    gen_server:call(RefCounterPid, {add, Pid}, infinity).
 
 count(RefCounterPid) ->
     gen_server:call(RefCounterPid, count).