You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2010/09/15 01:56:25 UTC

svn commit: r997153 - /couchdb/branches/1.0.x/src/couchdb/couch_rep_changes_feed.erl

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(_) ->