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/10/02 12:10:00 UTC

[GitHub] nickva closed pull request #1636: Improve connection cleanup in replication connection pool

nickva closed pull request #1636: Improve connection cleanup in replication connection pool
URL: https://github.com/apache/couchdb/pull/1636
 
 
   

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/couch_replicator/src/couch_replicator_connection.erl b/src/couch_replicator/src/couch_replicator_connection.erl
index 9c64723608..f3e4a864d5 100644
--- a/src/couch_replicator/src/couch_replicator_connection.erl
+++ b/src/couch_replicator/src/couch_replicator_connection.erl
@@ -156,7 +156,11 @@ handle_cast({connection_close_interval, V}, State) ->
 handle_info({'DOWN', Ref, process, _Pid, _Reason}, State) ->
     couch_stats:increment_counter([couch_replicator, connection,
         owner_crashes]),
-    ets:match_delete(?MODULE, #connection{mref=Ref, _='_'}),
+    Conns = ets:match_object(?MODULE, #connection{mref = Ref, _='_'}),
+    lists:foreach(fun(Conn) ->
+        couch_stats:increment_counter([couch_replicator, connection, closes]),
+        delete_worker(Conn)
+    end, Conns),
     {noreply, State};
 
 % worker crashed


 

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