diff options
author | hiddenpath <hiddenpath@yandex-team.com> | 2025-02-20 21:03:03 +0300 |
---|---|---|
committer | hiddenpath <hiddenpath@yandex-team.com> | 2025-02-20 22:13:49 +0300 |
commit | 2514a84c15eb175f940385fb8e109d8330827b8b (patch) | |
tree | 80d7ec158812c7ae68b34a8df1f5f193eec9e11b | |
parent | 26aea1d6bd2c2d51b8ba765beab156218ee64c19 (diff) | |
download | ydb-2514a84c15eb175f940385fb8e109d8330827b8b.tar.gz |
, YT-24294: Fix retry of 503 http code error without X-Yt-Error
commit_hash:a79152834c521c5dfea79b8a0b1af221078fb108
-rw-r--r-- | yt/cpp/mapreduce/http/http.cpp | 7 | ||||
-rw-r--r-- | yt/cpp/mapreduce/http/http_client.cpp | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/yt/cpp/mapreduce/http/http.cpp b/yt/cpp/mapreduce/http/http.cpp index 47b9859605..ae84926a2f 100644 --- a/yt/cpp/mapreduce/http/http.cpp +++ b/yt/cpp/mapreduce/http/http.cpp @@ -783,6 +783,10 @@ THttpResponse::THttpResponse( logAndSetError(NClusterErrorCodes::NRpc::Unavailable, ::TStringBuilder() << "internal error in proxy " << Context_.HostName); break; + case 503: + logAndSetError(NClusterErrorCodes::NBus::TransportError, "service unavailable"); + break; + default: { TStringStream httpHeaders; httpHeaders << "HTTP headers ("; @@ -801,9 +805,6 @@ THttpResponse::THttpResponse( if (auto parsedResponse = ParseError(HttpInput_->Headers())) { ErrorResponse_ = parsedResponse.GetRef(); - if (HttpCode_ == 503) { - ExtendGenericError(*ErrorResponse_, NClusterErrorCodes::NBus::TransportError, "transport error"); - } } else { ErrorResponse_ = TErrorResponse(TYtError(errorString + " - X-YT-Error is missing in headers"), Context_.RequestId); } diff --git a/yt/cpp/mapreduce/http/http_client.cpp b/yt/cpp/mapreduce/http/http_client.cpp index b22fcacb16..820bc0c36a 100644 --- a/yt/cpp/mapreduce/http/http_client.cpp +++ b/yt/cpp/mapreduce/http/http_client.cpp @@ -57,6 +57,9 @@ TMaybe<TErrorResponse> GetErrorResponse(const TString& hostName, const TString& case NHttp::EStatusCode::InternalServerError: return logAndSetError(NClusterErrorCodes::NRpc::Unavailable, "internal error in proxy " + hostName); + case NHttp::EStatusCode::ServiceUnavailable: + return logAndSetError(NClusterErrorCodes::NBus::TransportError, "service unavailable"); + default: { TStringStream httpHeaders; httpHeaders << "HTTP headers ("; @@ -81,9 +84,6 @@ TMaybe<TErrorResponse> GetErrorResponse(const TString& hostName, const TString& if (errorResponse.IsOk()) { return Nothing(); } - if (httpCode == NHttp::EStatusCode::ServiceUnavailable) { - ExtendGenericError(errorResponse, NClusterErrorCodes::NBus::TransportError, "transport error"); - } return errorResponse; } |