Skip to content

Commit

Permalink
rgw: fix miss handle curl error return
Browse files Browse the repository at this point in the history
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 9b70258)
  • Loading branch information
tianshan authored and xiaoxichen committed Jun 5, 2019
1 parent fc621bf commit 21d6c30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rgw/rgw_http_client.cc
Expand Up @@ -1141,7 +1141,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;
Expand Down

0 comments on commit 21d6c30

Please sign in to comment.