Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no retries on 4xx, max_retries=1 #1048

Merged
merged 2 commits into from
Oct 11, 2023
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
4 changes: 2 additions & 2 deletions clientlibs/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
changed in the next comment. that increases the likelihood that two PRs in-flight
at the same time that happen to rev to the same new version will be caught
by a merge conflict. -->
<!-- 3.1.3 -> 3.1.4: bugfix: send status as string -->
<version>3.1.4</version>
<!-- 3.1.4 -> 3.1.5: no retries for 4xx, retry other errors once instead of 3 times -->
<version>3.1.5</version>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.ws.rs.core.Response;

import static javax.ws.rs.core.Response.Status.Family.SUCCESSFUL;
import static javax.ws.rs.core.Response.Status.Family.CLIENT_ERROR;

public class PublishingRetryCallback<T> implements InvocationCallback<Response> {

Expand Down Expand Up @@ -35,7 +36,10 @@ public PublishingRetryCallback(AsyncInvoker invoker, Entity<T> message, int retr

@Override
public void completed(Response response) {
if (SUCCESSFUL.equals(response.getStatusInfo().getFamily()) || retries <= 0) {
boolean isSuccess = SUCCESSFUL.equals(response.getStatusInfo().getFamily());
boolean isClientRequestError = CLIENT_ERROR.equals(response.getStatusInfo().getFamily());

if (isSuccess || isClientRequestError || retries <= 0) {
callback.completed(response);
} else {
retry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Utils

public static final String PATCH = "PATCH";

public static final int MAX_RETRIES = 3;
public static final int MAX_RETRIES = 1;


public static enum RequestType {
Expand Down
Loading