couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject git commit: Avoid possible timeout initializing replications
Date Fri, 25 May 2012 13:30:10 GMT
Updated Branches:
  refs/heads/1.2.x 51000fd9c -> 5f93f0414


Avoid possible timeout initializing replications

If 2 different replications start and finish at about the same
time, there's a chance one is doing a synchronous gen_server
call to the replication manager (to notify it that it started)
while the replication manager is doing a call to the replication
supervisor because the other replication just finished.

COUCHDB-1461


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/5f93f041
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/5f93f041
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/5f93f041

Branch: refs/heads/1.2.x
Commit: 5f93f041411a6a00c6923a19c562b77c18f9341b
Parents: 51000fd
Author: Filipe David Borba Manana <fdmanana@apache.org>
Authored: Fri Apr 13 12:13:41 2012 +0100
Committer: Filipe David Borba Manana <fdmanana@apache.org>
Committed: Fri May 25 14:09:53 2012 +0100

----------------------------------------------------------------------
 src/couchdb/couch_replication_manager.erl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/5f93f041/src/couchdb/couch_replication_manager.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_replication_manager.erl b/src/couchdb/couch_replication_manager.erl
index 7b998a8..6421e78 100644
--- a/src/couchdb/couch_replication_manager.erl
+++ b/src/couchdb/couch_replication_manager.erl
@@ -431,7 +431,14 @@ replication_complete(DocId) ->
             % We want to be able to start the same replication but with
             % eventually different values for parameters that don't
             % contribute to its ID calculation.
-            _ = supervisor:delete_child(couch_rep_sup, BaseId ++ Ext);
+            case erlang:system_info(otp_release) < "R14B02" of
+            true ->
+                spawn(fun() ->
+                    _ = supervisor:delete_child(couch_rep_sup, BaseId ++ Ext)
+                end);
+            false ->
+                ok
+            end;
         #rep_state{} ->
             ok
         end,


Mime
View raw message