summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-08-28 03:04:27 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-08-28 03:04:27 +0000
commit53a20bd7ea70df880a7932e3399989275d2e61ef (patch)
tree5381b6c81671ad4777e4af53f8f6e07226ca6b45 /src
parent4b900a07dd82c94d87f873cf0b2a7e0a77cbf7b1 (diff)
couch_rep_httpc should know about 503s
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@808741 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_rep_httpc.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl
index 4ebbcefc..fdc640dd 100644
--- a/src/couchdb/couch_rep_httpc.erl
+++ b/src/couchdb/couch_rep_httpc.erl
@@ -100,14 +100,16 @@ process_response({ok, Status, Headers, Body}, Req) ->
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) ->