Return 503 for requests when we have a failure from
forward_request_to_master, we can probably fine tune things a little
here in the future by making rest_client and http_client return more
correct error messages depending on various failures
Fixes: http://tracker.ceph.com/issues/15501
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
if (!store->is_meta_master()) {
JSONParser jp;
op_ret = forward_request_to_master(s, NULL, store, in_data, &jp);
- if (op_ret < 0)
+ if (op_ret < 0) {
return;
+ }
JSONDecoder::decode_json("entry_point_object_ver", ep_objv, &jp);
JSONDecoder::decode_json("object_ver", objv, &jp);
}
int r = process(new_info.method, new_url.c_str());
- if (r < 0)
+ if (r < 0){
+ if (r == -EINVAL){
+ // curl_easy has errored, generally means the service is not available
+ r = -ERR_SERVICE_UNAVAILABLE;
+ }
return r;
+ }
response.append((char)0); /* NULL terminate response */