couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [2/4] couch-replicator commit: updated refs/heads/master to 89d57cd
Date Thu, 24 Mar 2016 18:31:43 GMT
Use transient restart type for all replications

We want replication tasks to be restarted automatically if they crash
abnormally. Replication tasks that complete or are cancelled (by
deleting the backing _replicator doc or issuing an "cancel":true for
non-persistent jobs) should still exit, should not be restarted, and
should not have their child spec linger in the supervisor.

COUCHDB-2975


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

Branch: refs/heads/master
Commit: eb93044ca4aa02ab4427ec7082df37bae6602973
Parents: 73afc58
Author: Robert Newson <rnewson@apache.org>
Authored: Thu Mar 24 11:29:10 2016 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Mar 24 12:17:24 2016 +0000

----------------------------------------------------------------------
 src/couch_replicator.erl | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/eb93044c/src/couch_replicator.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator.erl b/src/couch_replicator.erl
index 30cdd29..d887d68 100644
--- a/src/couch_replicator.erl
+++ b/src/couch_replicator.erl
@@ -123,7 +123,7 @@ async_replicate(#rep{id = {BaseId, Ext}, source = Src, target = Tgt} =
Rep) ->
     ChildSpec = {
         RepChildId,
         {gen_server, start_link, [?MODULE, Rep, [{timeout, Timeout}]]},
-        temporary,
+        transient,
         250,
         worker,
         [?MODULE]
@@ -306,16 +306,6 @@ do_init(#rep{options = Options, id = {BaseId, Ext}, user_ctx=UserCtx}
= Rep) ->
     ]),
     couch_task_status:set_update_frequency(1000),
 
-    % Until OTP R14B03:
-    %
-    % Restarting a temporary supervised child implies that the original arguments
-    % (#rep{} record) specified in the MFA component of the supervisor
-    % child spec will always be used whenever the child is restarted.
-    % This implies the same replication performance tunning parameters will
-    % always be used. The solution is to delete the child spec (see
-    % cancel_replication/1) and then start the replication again, but this is
-    % unfortunately not immune to race conditions.
-
     couch_log:notice("Replication `~p` is using:~n"
         "~c~p worker processes~n"
         "~ca worker batch size of ~p~n"


Mime
View raw message