Skip to content

Commit efaed97

Browse files
Remove retry logic from Android. (#1272)
- Removed retry logic from Android network code because it is not necessary due to better retry logic that already exists for all platforms inside OlpClient. - Now log message on connection timeout in OlpClient is more informative and prints url, timeout and retry_count of the request. Resolves: OLPSUP-16639 Signed-off-by: Serhii Lozynskyi <[email protected]>
1 parent ac2f92c commit efaed97

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

olp-cpp-sdk-core/src/client/OlpClient.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,12 @@ HttpResponse SendRequest(const http::NetworkRequest& request,
301301
}
302302

303303
if (!response_data->condition.Wait(timeout)) {
304-
OLP_SDK_LOG_WARNING_F(kLogTag, "Request %" PRIu64 " timed out!",
305-
outcome.GetRequestId());
304+
OLP_SDK_LOG_WARNING_F(
305+
kLogTag,
306+
"Request timed out, request_id=%" PRIu64
307+
", timeout=%i, retry_count=%i, url='%s'",
308+
outcome.GetRequestId(), static_cast<int>(timeout.count()),
309+
retry_settings.max_attempts, request.GetUrl().c_str());
306310
context.CancelOperation();
307311
return ToHttpResponse(kTimeoutErrorResponse);
308312
}

olp-cpp-sdk-core/src/http/android/NetworkAndroid.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,7 @@ SendOutcome NetworkAndroid::Send(NetworkRequest request,
956956
static_cast<jint>(request.GetSettings().GetTransferTimeout());
957957
const jint jproxy_port = static_cast<jint>(proxy_settings.GetPort());
958958
const jint jproxy_type = static_cast<jint>(proxy_settings.GetType());
959-
const jint jmax_retries =
960-
static_cast<jint>(request.GetSettings().GetRetries());
959+
const jint jmax_retries = 1;
961960
// Do sending
962961
{
963962
std::lock_guard<std::mutex> lock(requests_mutex_);

0 commit comments

Comments
 (0)