nickva commented on code in PR #6031:
URL: https://github.com/apache/couchdb/pull/6031#discussion_r3389178895
##########
src/couch_replicator/src/couch_replicator_docs.erl:
##########
@@ -226,6 +248,31 @@ save_rep_doc(DbName, Doc) ->
couch_db:close(Db)
end.
+defer_call(Fun) ->
+ {Pid, Ref} = spawn_monitor(fun() ->
+ try Fun() of
+ Resp ->
+ exit({exit_ok, Resp})
+ catch
+ throw:Reason ->
+ exit({exit_throw, Reason});
+ error:Reason ->
+ exit({exit_error, Reason});
+ exit:Reason ->
+ exit({exit_exit, Reason})
+ end
+ end),
+ receive
+ {'DOWN', Ref, process, Pid, {exit_ok, Ret}} ->
+ Ret;
+ {'DOWN', Ref, process, Pid, {exit_throw, Reason}} ->
+ throw(Reason);
+ {'DOWN', Ref, process_, Pid, {exit_error, Reason}} ->
Review Comment:
typo :`process_` will deadlock on exits
##########
src/couch_replicator/src/couch_replicator_docs.erl:
##########
@@ -209,6 +215,22 @@ open_rep_doc(DbName, DocId) ->
Else
end.
+save_rep_doc(<<"shards/", _/binary>> = ShardDbName, Doc) ->
+ DbName = mem3:dbname(ShardDbName),
+ ioq:maybe_set_io_priority({system, DbName}),
Review Comment:
This doesn't do anything. Ioq settings go into a process dict and spawning a
new process make it ineffective
##########
src/couch_replicator/src/couch_replicator_docs.erl:
##########
@@ -196,6 +196,12 @@ update_rep_doc(RepDbName, #doc{body = {RepDocBody}} =
RepDoc, KVs, _Try) ->
save_rep_doc(RepDbName, RepDoc#doc{body = {NewRepDocBody}})
end.
+open_rep_doc(<<"shards/", _/binary>> = ShardDbName, DocId) ->
+ DbName = mem3:dbname(ShardDbName),
+ ioq:maybe_set_io_priority({system, DbName}),
Review Comment:
ioq setting here will fail same reason as above
--
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]