diff options
author | mrlolthe1st <mrlolthe1st@yandex-team.com> | 2023-03-07 12:40:33 +0300 |
---|---|---|
committer | mrlolthe1st <mrlolthe1st@yandex-team.com> | 2023-03-07 12:40:33 +0300 |
commit | 7bcc73baa9a21ef14da7dec5b5cc48c5794784df (patch) | |
tree | 32892ed4c37d24732d2112b04ef51424727475d2 | |
parent | 33ed6077e694c2f1286c01ebe1be30b189850e77 (diff) | |
download | ydb-7bcc73baa9a21ef14da7dec5b5cc48c5794784df.tar.gz |
Trying to fix DQRun hanging, set finite timeouts and retry count
Set finite timeouts
4 files changed, 20 insertions, 19 deletions
diff --git a/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.cpp b/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.cpp index be50dc2c72c..01edb1587db 100644 --- a/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.cpp +++ b/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.cpp @@ -2,7 +2,7 @@ namespace NYql { -IRetryPolicy<long>::TPtr GetHTTPDefaultRetryPolicy(TDuration maxTime) { +IRetryPolicy<long>::TPtr GetHTTPDefaultRetryPolicy(TDuration maxTime, size_t maxRetries) { if (!maxTime) { maxTime = TDuration::Minutes(5); } @@ -25,7 +25,7 @@ IRetryPolicy<long>::TPtr GetHTTPDefaultRetryPolicy(TDuration maxTime) { TDuration::MilliSeconds(10), // minDelay TDuration::MilliSeconds(200), // minLongRetryDelay TDuration::Seconds(30), // maxDelay - std::numeric_limits<size_t>::max(), // maxRetries + maxRetries, // maxRetries maxTime); // maxTime } diff --git a/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.h b/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.h index 425f1a55e04..4a245a8b4f4 100644 --- a/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.h +++ b/ydb/library/yql/providers/common/http_gateway/yql_http_default_retry_policy.h @@ -4,6 +4,6 @@ namespace NYql { -IRetryPolicy<long>::TPtr GetHTTPDefaultRetryPolicy(TDuration maxTime = TDuration::Zero()); // Zero means default maxTime +IRetryPolicy<long>::TPtr GetHTTPDefaultRetryPolicy(TDuration maxTime = TDuration::Zero(), size_t maxRetries = std::numeric_limits<size_t>::max()); // Zero means default maxTime } diff --git a/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp b/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp index 930f9cb7d13..0ba8ddee48a 100644 --- a/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp +++ b/ydb/library/yql/providers/common/http_gateway/yql_http_gateway.cpp @@ -27,34 +27,34 @@ int curlTrace(CURL *handle, curl_infotype type, Y_UNUSED(data); TStringBuf buf(data, size); + TStringBuilder sb; switch (type) { case CURLINFO_TEXT: - Cerr << "== Info: " << buf; + sb << "== Info: " << buf; break; case CURLINFO_HEADER_OUT: - Cerr << "=> Send header (" << size << " bytes):" << Endl << buf; + sb << "=> Send header (" << size << " bytes):" << Endl << buf; break; case CURLINFO_HEADER_IN: - Cerr << "<= Recv header (" << size << " bytes):" << buf; + sb << "<= Recv header (" << size << " bytes):" << buf; break; - default: - return 0; - -/* - case CURLINFO_DATA_OUT: - Cerr << "=> Send data (" << size << " bytes)" << Endl; + /*case CURLINFO_DATA_OUT: + sb << "=> Send data (" << size << " bytes)" << Endl; break; case CURLINFO_SSL_DATA_OUT: - Cerr << "=> Send SSL data (" << size << " bytes)" << Endl; + sb << "=> Send SSL data (" << size << " bytes)" << Endl; break; case CURLINFO_DATA_IN: - Cerr << "<= Recv data (" << size << " bytes)" << Endl; + sb << "<= Recv data (" << size << " bytes)" << Endl; break; case CURLINFO_SSL_DATA_IN: - Cerr << "<= Recv SSL data (" << size << " bytes)" << Endl; - break; -*/ + sb << "<= Recv SSL data (" << size << " bytes)" << Endl; + break;*/ + default: + return 0; } + + Cerr << sb; return 0; } @@ -64,10 +64,10 @@ namespace NYql { namespace { struct TCurlInitConfig { - ui64 RequestTimeout = 0; + ui64 RequestTimeout = 150; ui64 LowSpeedTime = 0; ui64 LowSpeedLimit = 0; - ui64 ConnectionTimeout = 0; + ui64 ConnectionTimeout = 15; ui64 BytesPerSecondLimit = 0; ui64 BufferSize = CURL_MAX_WRITE_SIZE; }; diff --git a/ydb/library/yql/providers/common/proto/gateways_config.proto b/ydb/library/yql/providers/common/proto/gateways_config.proto index 2726661e48a..b4ce6859832 100644 --- a/ydb/library/yql/providers/common/proto/gateways_config.proto +++ b/ydb/library/yql/providers/common/proto/gateways_config.proto @@ -82,6 +82,7 @@ message THttpGatewayConfig { optional uint64 LowSpeedTimeSeconds = 8; optional uint64 LowSpeedBytesLimit = 9; optional TDnsResolverConfig DnsResolverConfig = 10; + optional uint64 MaxRetries = 11; } /////////////////////////////// YT /////////////////////////////// |