nickva commented on code in PR #5152:
URL: https://github.com/apache/couchdb/pull/5152#discussion_r1693596833
##########
src/fabric/src/fabric_streams.erl:
##########
@@ -158,39 +176,49 @@ handle_stream_start(Else, _, _) ->
% Spawn an auxiliary rexi worker cleaner. This will be used in cases
% when the coordinator (request) process is forceably killed and doesn't
% get a chance to process its `after` fabric:clean/1 clause.
-spawn_worker_cleaner(Coordinator, Workers, ClientReq) ->
+spawn_worker_cleaner(Coordinator, Workers, ClientReq) when
+ is_pid(Coordinator), is_list(Workers)
+->
case get(?WORKER_CLEANER) of
undefined ->
Pid = spawn(fun() ->
erlang:monitor(process, Coordinator),
- cleaner_loop(Coordinator, Workers, ClientReq)
+ NodeRefSet = set_from_list(shards_to_node_refs(Workers)),
Review Comment:
Noticed that we don't really need to keep the whole list of shards in memory
in the cleaner process. For Q=64, N=3 that can add up to a decent blob of
binary paths. We only need node names (atoms) and refs. So updated to use just
a set of `[{Node, Ref}, ...]`. A set since in theory someone would add the same
worker twice to it.
--
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]