rnewson commented on code in PR #5036:
URL: https://github.com/apache/couchdb/pull/5036#discussion_r1577415538
##########
src/couch_replicator/src/couch_replicator_scheduler.erl:
##########
@@ -623,28 +627,20 @@ start_job_int(#job{pid = Pid}, _State) when Pid /=
undefined ->
ok;
start_job_int(#job{} = Job0, State) ->
Job = maybe_optimize_job_for_rate_limiting(Job0),
- case couch_replicator_scheduler_sup:start_child(Job#job.rep) of
+ case couch_replicator_scheduler_job:start_link(Job#job.rep) of
{ok, Child} ->
- Ref = monitor(process, Child),
- ok = update_state_started(Job, Child, Ref, State),
+ ok = update_state_started(Job, Child, State),
couch_log:notice(
"~p: Job ~p started as ~p",
[?MODULE, Job#job.id, Child]
);
- {error, {already_started, OtherPid}} when node(OtherPid) =:= node() ->
- Ref = monitor(process, OtherPid),
- ok = update_state_started(Job, OtherPid, Ref, State),
- couch_log:notice(
- "~p: Job ~p already running as ~p. Most likely"
- " because replicator scheduler was restarted",
- [?MODULE, Job#job.id, OtherPid]
- );
- {error, {already_started, OtherPid}} when node(OtherPid) =/= node() ->
- CrashMsg = "Duplicate replication running on another node",
- couch_log:notice(
- "~p: Job ~p already running as ~p. Most likely"
+ {error, {already_started, OtherPid}} ->
+ Node = node(OtherPid),
+ CrashMsg = "Duplicate replication running on " ++
atom_to_list(Node),
+ couch_log:warning(
+ "~p: Job ~p already running as ~p on node ~s"
" because a duplicate replication is running on another node",
Review Comment:
remove this line?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]