You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2017/03/01 16:38:12 UTC

[14/50] fabric commit: updated refs/heads/2971-count-distinct to 5d18415

End continuous changes feeds cleanly if database is deleted

COUCHDB-3132


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/c7214fd2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/c7214fd2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/c7214fd2

Branch: refs/heads/2971-count-distinct
Commit: c7214fd2fef2fdbbf47964f6017c71ec8e8196ca
Parents: 78eb096
Author: Robert Newson <rn...@apache.org>
Authored: Wed Sep 7 18:56:14 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Sep 7 18:56:14 2016 +0100

----------------------------------------------------------------------
 src/fabric_db_update_listener.erl | 4 ++--
 src/fabric_view_changes.erl       | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/c7214fd2/src/fabric_db_update_listener.erl
----------------------------------------------------------------------
diff --git a/src/fabric_db_update_listener.erl b/src/fabric_db_update_listener.erl
index 733be89..074ec53 100644
--- a/src/fabric_db_update_listener.erl
+++ b/src/fabric_db_update_listener.erl
@@ -122,8 +122,8 @@ wait_db_updated({Pid, Ref}) ->
         {state, Pid, State} ->
             erlang:demonitor(MonRef, [flush]),
             State;
-        {'DOWN', MonRef, process, Pid, Reason} ->
-            throw({changes_feed_died, Reason})
+        {'DOWN', MonRef, process, Pid, _Reason} ->
+            changes_feed_died
     after 300000 ->
         ?MODULE:wait_db_updated({Pid, Ref})
     end.

http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/c7214fd2/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index 7e329ac..8f7a6f1 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -103,6 +103,8 @@ keep_sending_changes(DbName, Args, Callback, Seqs, AccIn, Timeout, UpListen, T0)
             list_to_integer(MaxStr)
         end,
         case {Heartbeat, AccumulatedTime > Max, WaitForUpdate} of
+        {_, _, changes_feed_died} ->
+            Callback({stop, LastSeq, pending_count(Offset)}, AccOut);
         {undefined, _, timeout} ->
             Callback({stop, LastSeq, pending_count(Offset)}, AccOut);
         {_, true, timeout} ->