]> 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)
committerNathan Cutler <ncutler@suse.com>
Wed, 24 Jul 2019 14:29:24 +0000 (16:29 +0200)
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>
(cherry picked from commit 9b7025857026c64cf076e82d762556ac2bcd2625)

src/rgw/rgw_http_client.cc

index a4b0e270f15aeec03211eb77d504d087ec22d95d..7bf3f968a34dd1bfb6cbc23d1e079198b4e4f5be 100644 (file)
@@ -1142,7 +1142,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;