From 172fc49837c51d43b7c35dea78968d9e25cd0d94 Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Tue, 11 Jul 2023 12:46:59 +0530 Subject: [PATCH] Tweak timeouts. --- include/http_proxy.h | 2 +- src/collection_manager.cpp | 2 +- src/http_client.cpp | 4 +--- src/http_proxy.cpp | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/http_proxy.h b/include/http_proxy.h index 438fbda0..dee7c015 100644 --- a/include/http_proxy.h +++ b/include/http_proxy.h @@ -24,7 +24,7 @@ struct http_proxy_res_t { class HttpProxy { // singleton class for http proxy public: - static const size_t default_timeout_ms = 30000*4; + static const size_t default_timeout_ms = 60000; static const size_t default_num_try = 2; static HttpProxy& get_instance() { diff --git a/src/collection_manager.cpp b/src/collection_manager.cpp index 39217969..ac740da8 100644 --- a/src/collection_manager.cpp +++ b/src/collection_manager.cpp @@ -838,7 +838,7 @@ Option CollectionManager::do_search(std::map& re text_match_type_t match_type = max_score; size_t vector_query_hits = 250; - size_t remote_embedding_timeout_ms = 30000; + size_t remote_embedding_timeout_ms = 5000; size_t remote_embedding_num_try = 2; size_t facet_sample_percent = 100; diff --git a/src/http_client.cpp b/src/http_client.cpp index 638c9ef7..a1bea098 100644 --- a/src/http_client.cpp +++ b/src/http_client.cpp @@ -158,10 +158,8 @@ long HttpClient::perform_curl(CURL *curl, std::map& re if(res == CURLE_OPERATION_TIMEDOUT) { double total_time; - char* http_method; curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total_time); - curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_METHOD, http_method); - LOG(ERROR) << "CURL timeout. Time taken: " << total_time << ", URL: " << http_method << " " << url; + LOG(ERROR) << "CURL timeout. Time taken: " << total_time << ", URL: " << url; status_code = 408; } else { LOG(ERROR) << "CURL failed. URL: " << url << ", Code: " << res << ", strerror: " << curl_easy_strerror(res); diff --git a/src/http_proxy.cpp b/src/http_proxy.cpp index f3734652..f4fceba2 100644 --- a/src/http_proxy.cpp +++ b/src/http_proxy.cpp @@ -68,7 +68,8 @@ http_proxy_res_t HttpProxy::send(const std::string& url, const std::string& meth break; } - LOG(ERROR) << "Proxy call failed, status_code: " << res.status_code << ", num_try: " << num_try; + LOG(ERROR) << "Proxy call failed, status_code: " << res.status_code + << ", timeout_ms: " << timeout_ms << ", num_try: " << num_try; } if(res.status_code == 408){