kocolosk commented on a change in pull request #3940:
URL: https://github.com/apache/couchdb/pull/3940#discussion_r814341172



##########
File path: src/couch/src/couch_httpd_multipart.erl
##########
@@ -134,6 +138,10 @@ mp_abort_parse_atts(_, _) ->
 
 maybe_send_data({Ref, Chunks, Offset, Counters, Waiting}) ->
     receive
+        {hello_from_writer, Ref, WriterPid} ->
+            WriterRef = erlang:monitor(process, WriterPid),
+            NewCounters = orddict:store(WriterPid, {WriterRef, 0}, Counters),

Review comment:
       @nickva now that you pointed out the existence of multiple writers for a 
given `WriterPid` I think this logic to initialize the count to 0 for each 
writer is wrong. I I think it will cause `maybe_send_data` to use the wrong 
index when sending chunks to writers of attachments 2..N, because the index is 
on the set of all chunks for the entire HTTP request. You agree?




-- 
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]


Reply via email to