]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix miss handle curl error return
authorTianshan Qu <tianshan@xsky.com>
Fri, 31 May 2019 10:37:44 +0000 (18:37 +0800)
committerTianshan Qu <tianshan@xsky.com>
Tue, 4 Jun 2019 03:33:17 +0000 (11:33 +0800)
if meet tcp packet loss, curl return will be result=18(CURLE_PARTIAL_FILE)
and http_status=200, so sync will continue and cause content miss match.

Fixes: https://tracker.ceph.com/issues/39992
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
src/rgw/rgw_http_client.cc

index 8b36c2f78e86909e50c89df52c1774ef8758325d..b382990a40e745da4dbc3d06c311dfab3ce314e0 100644 (file)
@@ -1173,7 +1173,8 @@ void *RGWHTTPManager::reqs_thread_entry()
        curl_easy_getinfo(e, CURLINFO_RESPONSE_CODE, (void **)&http_status);
 
        int status = rgw_http_error_to_errno(http_status);
-        if (result != CURLE_OK && http_status == 0) {
+        if (result != CURLE_OK && status == 0) {
+          dout(0) << "ERROR: curl error: " << curl_easy_strerror((CURLcode)result) << ", maybe network unstable" << dendl;
           status = -EAGAIN;
         }
         int id = req_data->id;