Prevent attachment upload from timing out during update_docs fabric call 89/head
authorNick Vatamaniuc <vatamane@apache.org>
Tue, 21 Feb 2017 22:46:57 +0000 (17:46 -0500)
committerNick Vatamaniuc <vatamane@apache.org>
Tue, 21 Feb 2017 22:46:57 +0000 (17:46 -0500)
Currently if an attachment was large enough or the connection was slow enough
such that it took more than fabric.request_timeout = 60000 milliseconds, the
fabric request would time out during attachment data transfer from coordinator
node to other nodes and the whole request would fail.

This was most evident when replicating database with large attachments.

The fix is to periodically send `attachment_chunk_received` to coordinator to
prevent the timeout.

COUCHDB-3302

src/fabric_rpc.erl

index 679a305..80b110a 100644 (file)
@@ -422,6 +422,7 @@ make_att_reader({follows, Parser, Ref}) ->
         Parser ! {get_bytes, Ref, self()},
         receive
             {bytes, Ref, Bytes} ->
+                rexi:reply(attachment_chunk_received),
                 Bytes;
             {'DOWN', ParserRef, _, _, Reason} ->
                 throw({mp_parser_died, Reason})