From 65a6a95c361385f14757c3adf80b84d7817a0ac2 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Mon, 28 Mar 2011 11:10:16 +0000 Subject: Backport fix from revision 1086185 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 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1086186 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index 596233df..217d8efe 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -315,7 +315,14 @@ start_replication_server(Replicator) -> throw({db_not_found, <<"could not open ", DbUrl/binary>>}); {error, {unauthorized, DbUrl}} -> throw({unauthorized, - <<"unauthorized to access database ", DbUrl/binary>>}) + <<"unauthorized to access database ", DbUrl/binary>>}); + {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, RepId), + start_replication_server(Replicator) end; {error, {already_started, Pid}} -> ?LOG_DEBUG("replication ~p already running at ~p", [RepId, Pid]), -- cgit v1.2.3