You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2016/07/12 13:59:16 UTC

[1/2] chttpd commit: updated refs/heads/master to 5e3bf1f

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 9a59ca11a -> 5e3bf1f5e


Don't end changes feed listener on heartbeat

There's no need to end and restart the changes feed listener on every
heartbeat, so don't do that.

COUCHDB-3054


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

Branch: refs/heads/master
Commit: fc7287a9eddca2f1d114853bc555b07c0a6ea3f8
Parents: 9a59ca1
Author: Robert Newson <rn...@apache.org>
Authored: Tue Jul 12 10:21:24 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Jul 12 12:04:49 2016 +0100

----------------------------------------------------------------------
 src/chttpd_auth_cache.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/fc7287a9/src/chttpd_auth_cache.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_auth_cache.erl b/src/chttpd_auth_cache.erl
index b676bf7..75d77e8 100644
--- a/src/chttpd_auth_cache.erl
+++ b/src/chttpd_auth_cache.erl
@@ -157,8 +157,8 @@ changes_callback({change, {Change}}, _) ->
             ets_lru:remove(?CACHE, UserName)
     end,
     {ok, couch_util:get_value(seq, Change)};
-changes_callback(timeout, EndSeq) ->
-    exit({seq, EndSeq});
+changes_callback(timeout, Acc) ->
+    {ok, Acc};
 changes_callback({error, _}, EndSeq) ->
     exit({seq, EndSeq}).
 


[2/2] chttpd commit: updated refs/heads/master to 5e3bf1f

Posted by rn...@apache.org.
Tolerate failure of ensure_auth_ddoc_exists call

ensure_auth_ddoc_exists can crash if _users db does not exist, so move
it to the spawned listen_for_changes process where we already tolerate
the possibility of a crash (and have logic to restart after 5 seconds)

COUCHDB-3054


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

Branch: refs/heads/master
Commit: 5e3bf1f5e2e96841ce0d2b26606c7f590c067bdc
Parents: fc7287a
Author: Robert Newson <rn...@apache.org>
Authored: Tue Jul 12 13:23:05 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Jul 12 13:23:05 2016 +0100

----------------------------------------------------------------------
 src/chttpd_auth_cache.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/5e3bf1f5/src/chttpd_auth_cache.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_auth_cache.erl b/src/chttpd_auth_cache.erl
index 75d77e8..c8a6ea9 100644
--- a/src/chttpd_auth_cache.erl
+++ b/src/chttpd_auth_cache.erl
@@ -112,7 +112,6 @@ handle_info({'DOWN', _, _, Pid, Reason}, #state{changes_pid=Pid} = State) ->
     erlang:send_after(5000, self(), {start_listener, Seq}),
     {noreply, State#state{last_seq=Seq}};
 handle_info({start_listener, Seq}, State) ->
-    ensure_auth_ddoc_exists(dbname(), <<"_design/_auth">>),
     {noreply, State#state{changes_pid = spawn_changes(Seq)}};
 handle_info(_Msg, State) ->
     {noreply, State}.
@@ -132,6 +131,7 @@ spawn_changes(Since) ->
     Pid.
 
 listen_for_changes(Since) ->
+    ensure_auth_ddoc_exists(dbname(), <<"_design/_auth">>),
     CBFun = fun ?MODULE:changes_callback/2,
     Args = #changes_args{
         feed = "continuous",