Skip to content

Commit

Permalink
Avoid possible timeout initializing replications
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fdmanana committed May 25, 2012
1 parent a6eaf9f commit e4d3e15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/couch_replicator/src/couch_replicator_manager.erl
Expand Up @@ -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_replicator_job_sup, BaseId ++ Ext);
case erlang:system_info(otp_release) < "R14B02" of

This comment has been minimized.

Copy link
@benoitc

benoitc Jun 11, 2012

Contributor

why only this version. Same bug appear in r15 as well...

true ->
spawn(fun() ->
_ = supervisor:delete_child(couch_replicator_job_sup, BaseId ++ Ext)
end);
false ->
ok
end;
#rep_state{} ->
ok
end,
Expand Down

0 comments on commit e4d3e15

Please sign in to comment.