couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r997153 - /couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl
Date Tue, 14 Sep 2010 23:56:25 GMT
Author: fdmanana
Date: Tue Sep 14 23:56:24 2010
New Revision: 997153

URL: http://svn.apache.org/viewvc?rev=997153&view=rev
Log:
Merged revision 997152 from trunk:

Replicator bug fix: make sure a replication fails when there's a stale connection to a remote
DB's _changes.

Modified:
    couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl

Modified: couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl?rev=997153&r1=997152&r2=997153&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl Tue Sep 14 23:56:24 2010
@@ -210,9 +210,16 @@ handle_info({'EXIT', From, Reason}, #sta
 handle_info({'EXIT', _From, normal}, State) ->
     {noreply, State};
 
-handle_info(Msg, State) ->
-    ?LOG_DEBUG("unexpected message at changes_feed ~p", [Msg]),
-    {noreply, State}.
+handle_info(Msg, #state{init_args = InitArgs} = State) ->
+    case Msg of
+    changes_timeout ->
+        [_, #http_db{url = Url} | _] = InitArgs,
+        ?LOG_ERROR("changes loop timeout, no data received from ~s",
+            [couch_util:url_strip_password(Url)]);
+    _ ->
+        ?LOG_ERROR("changes loop received unexpected message ~p", [Msg])
+    end,
+    {stop, Msg, State}.
 
 terminate(_Reason, State) ->
     #state{
@@ -377,7 +384,7 @@ maybe_stream_next(#state{reqid=nil}) ->
     ok;
 maybe_stream_next(#state{complete=false, count=N} = S) when N < ?BUFFER_SIZE ->
     timer:cancel(get(timeout)),
-    {ok, Timeout} = timer:exit_after(31000, changes_timeout),
+    {ok, Timeout} = timer:send_after(31000, changes_timeout),
     put(timeout, Timeout),
     ibrowse:stream_next(S#state.reqid);
 maybe_stream_next(_) ->



Mime
View raw message