couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1104168 - /couchdb/trunk/src/couchdb/couch_ref_counter.erl
Date Tue, 17 May 2011 11:41:13 GMT
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).



Mime
View raw message