couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1086185 - /couchdb/trunk/src/couchdb/couch_replicator.erl
Date Mon, 28 Mar 2011 11:08:59 GMT
Author: fdmanana
Date: Mon Mar 28 11:08:58 2011
New Revision: 1086185

URL: http://svn.apache.org/viewvc?rev=1086185&view=rev
Log:
Replicator: fix error when restarting replications in OTP R14B02

This is a workaround for a change introduced in OTP R14B02 to the supervisor
module. There's an erlang-bugs thread about this issue:

http://erlang.org/pipermail/erlang-bugs/2011-March/002273.html


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

Modified: couchdb/trunk/src/couchdb/couch_replicator.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_replicator.erl?rev=1086185&r1=1086184&r2=1086185&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_replicator.erl (original)
+++ couchdb/trunk/src/couchdb/couch_replicator.erl Mon Mar 28 11:08:58 2011
@@ -136,6 +136,13 @@ async_replicate(#rep{id = {BaseId, Ext},
             ?LOG_INFO("replication `~s` already running at ~p (`~s` -> `~s`)",
                 [RepChildId, Pid, Source, Target]),
             {ok, Pid};
+        {error, {'EXIT', {badarg,
+            [{erlang, apply, [gen_server, start_link, undefined]} | _]}}} ->
+            % Clause to deal with a change in the supervisor module introduced
+            % in R14B02. For more details consult the thread at:
+            %     http://erlang.org/pipermail/erlang-bugs/2011-March/002273.html
+            _ = supervisor:delete_child(couch_rep_sup, RepChildId),
+            async_replicate(Rep);
         {error, _} = Error ->
             Error
         end;



Mime
View raw message