Author: fdmanana
Date: Thu Jun 23 09:46:46 2011
New Revision: 1138799
URL: http://svn.apache.org/viewvc?rev=1138799&view=rev
Log:
Merged revision 1104168 from trunk
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/branches/1.1.x/src/couchdb/couch_ref_counter.erl
Modified: couchdb/branches/1.1.x/src/couchdb/couch_ref_counter.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_ref_counter.erl?rev=1138799&r1=1138798&r2=1138799&view=diff
==============================================================================
--- couchdb/branches/1.1.x/src/couchdb/couch_ref_counter.erl (original)
+++ couchdb/branches/1.1.x/src/couchdb/couch_ref_counter.erl Thu Jun 23 09:46:46 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).
|