From 9b7025857026c64cf076e82d762556ac2bcd2625 Mon Sep 17 00:00:00 2001 From: Tianshan Qu Date: Fri, 31 May 2019 18:37:44 +0800 Subject: [PATCH] rgw: fix miss handle curl error return 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 --- src/rgw/rgw_http_client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_http_client.cc b/src/rgw/rgw_http_client.cc index 8b36c2f78e869..b382990a40e74 100644 --- a/src/rgw/rgw_http_client.cc +++ b/src/rgw/rgw_http_client.cc @@ -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; -- 2.39.5