You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/04/04 15:58:28 UTC

[GitHub] janl closed pull request #1265: Kill fabric attachment receiver when middleman times out

janl closed pull request #1265: Kill fabric attachment receiver when middleman times out
URL: https://github.com/apache/couchdb/pull/1265
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/fabric/src/fabric_doc_attachments.erl b/src/fabric/src/fabric_doc_attachments.erl
index 47854d1898..7c6ba66106 100644
--- a/src/fabric/src/fabric_doc_attachments.erl
+++ b/src/fabric/src/fabric_doc_attachments.erl
@@ -105,13 +105,13 @@ middleman(Req, chunked) ->
 
     % take requests from the DB writers and get data from the receiver
     N = erlang:list_to_integer(config:get("cluster","n")),
-    Timeout = fabric_util:request_timeout(),
+    Timeout = fabric_util:attachments_timeout(),
     middleman_loop(Receiver, N, [], [], Timeout);
 
 middleman(Req, Length) ->
     Receiver = spawn(fun() -> receive_unchunked_attachment(Req, Length) end),
     N = erlang:list_to_integer(config:get("cluster","n")),
-    Timeout = fabric_util:request_timeout(),
+    Timeout = fabric_util:attachments_timeout(),
     middleman_loop(Receiver, N, [], [], Timeout).
 
 middleman_loop(Receiver, N, Counters0, ChunkList0, Timeout) ->
@@ -153,5 +153,6 @@ middleman_loop(Receiver, N, Counters0, ChunkList0, Timeout) ->
 
         middleman_loop(Receiver, N, Counters3, ChunkList3, Timeout)
     after Timeout ->
+        exit(Receiver, kill),
         ok
     end.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services