couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r808741 - /couchdb/trunk/src/couchdb/couch_rep_httpc.erl
Date Fri, 28 Aug 2009 03:04:27 GMT
Author: kocolosk
Date: Fri Aug 28 03:04:27 2009
New Revision: 808741

URL: http://svn.apache.org/viewvc?rev=808741&view=rev
Log:
couch_rep_httpc should know about 503s

Modified:
    couchdb/trunk/src/couchdb/couch_rep_httpc.erl

Modified: couchdb/trunk/src/couchdb/couch_rep_httpc.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_httpc.erl?rev=808741&r1=808740&r2=808741&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_httpc.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_httpc.erl Fri Aug 28 03:04:27 2009
@@ -100,14 +100,16 @@
         throw(conflict);
     Code >= 400, Code < 500 ->
         ?JSON_DECODE(maybe_decompress(Headers, Body));
-    Code =:= 500; Code =:= 502 ->
+    Code =:= 500; Code =:= 502; Code =:= 503 ->
         #http_db{pause = Pause, retries = Retries} = Req,
         ?LOG_INFO("retrying couch_rep_httpc request in ~p seconds " ++
             % "due to remote server error: ~s~s", [Pause/1000, Req#http_db.url,
             "due to remote server error: ~p Body ~s", [Pause/1000, Code,
             Body]),
         timer:sleep(Pause),
-        do_request(Req#http_db{retries = Retries-1, pause = 2*Pause})
+        do_request(Req#http_db{retries = Retries-1, pause = 2*Pause});
+    true ->
+        exit({http_request_failed, ?l2b(["unhandled response code ", Status])})
     end;
 
 process_response({ibrowse_req_id, Id}, _Req) ->



Mime
View raw message