Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencyResolutionManagement {
versionCatalogs {
libs {
// main sdk version
version('sdk', '1.9.0');
version('sdk', '1.9.1');

// sdk deps
version('okhttp3', '4.12.0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Response intercept(@NotNull Chain chain) throws IOException {
String.format(
Locale.getDefault(), "httpCode=%d %s", response.code(), response.message());
if (!shouldRetryHttpErrorCode(response.code())) {
return response;
return getReturnResp(chain, response, "nullcheck: shouldRetryHttpErrorCode is false");
}
} else if (tryCount > 1) {
log.info(
Expand All @@ -83,7 +83,7 @@ public Response intercept(@NotNull Chain chain) throws IOException {
response = makeErrorResp(chain, msg);
successful = false;
if (!shouldRetryException(ex)) {
return response;
return getReturnResp(chain, response, "nullcheck: shouldRetryException is false");
}
}

Expand All @@ -110,7 +110,8 @@ public Response intercept(@NotNull Chain chain) throws IOException {
tryCount,
chain.request().url(),
msg);
return response; // Exit without further retries
return getReturnResp(
chain, response, "nullcheck: isShuttingDown is true"); // Exit without further retries
}

log.warn(
Expand All @@ -134,7 +135,21 @@ public Response intercept(@NotNull Chain chain) throws IOException {
tryCount++;
} while (!successful && (retryForever || tryCount <= maxTryCount) && !isShuttingDown.get());

return response;
return getReturnResp(
chain,
response,
String.format(
"nullcheck: exit loop successful=%s, retryForever=%s tryCount=%d maxTryCount=%d shutdown=%s",
successful, retryForever, tryCount, maxTryCount, isShuttingDown.get()));
}

// interceptor should never return null, create dummy resp and embed an error msg if it does
private Response getReturnResp(Chain chain, Response resp, String msg) {
if (resp != null) {
return resp;
}

return makeErrorResp(chain, String.format(msg, "%s url: %s", chain.request().url()));
}

int getRetryAfterHeaderInSeconds(Response response) {
Expand Down