Commits

Anonymous committed b814ea2

produce HTTP 503 on GET timeouts (closes #190)

Comments (0)

Files changed (1)

apps/riak_kv/src/riak_kv_wm_raw.erl

                       {"multipart/mixed", produce_multipart_body}], RD, DocCtx}
             end;
         {error, notfound} ->
-            {[{"text/plain", produce_error_message}], RD, DocCtx}
+            {[{"text/plain", produce_error_message}], RD, DocCtx};
+        {error, timeout} ->
+            {[{"text/plain", produce_error_body}], RD, DocCtx}
     end.
 
 %% @spec charsets_provided(reqdata(), context()) ->
                     {no_charset, RD, DocCtx}
             end;
         {error, notfound} ->
+            {no_charset, RD, DocCtx};
+        {error, timeout} ->
             {no_charset, RD, DocCtx}
     end.
 
                     {default_encodings(), RD, DocCtx}
             end;
         {error, notfound} ->
+            {default_encodings(), RD, DocCtx};
+        {error, timeout} ->
             {default_encodings(), RD, DocCtx}
     end.
 
                      RD, DocCtx#ctx{vtag=Vtag}}
             end;
         {error, notfound} ->
-            {false, RD, DocCtx}
+            {false, RD, DocCtx};
+        {error, timeout} ->
+            {{halt, 503}, RD, DocCtx}
     end.
 
 %% @spec produce_bucket_body(reqdata(), context()) -> {binary(), reqdata(), context()}