Skip to content

OWLS-90614 - Handle ApiException with 409 code returned from the replaceEvent API call #2443

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

Merged
merged 3 commits into from
Jul 8, 2021

Conversation

ankedia
Copy link
Member

@ankedia ankedia commented Jul 6, 2021

Code to handle ApiException with 409 status code in the replaceEvent async API call seen in the GBU large cluster environment. The code will treat this exception similar to the "404 - Not Found" error so that a new event can be created.

@ankedia ankedia requested review from doxiao and rjeberhard July 6, 2021 22:16
@@ -66,7 +67,12 @@ public static boolean isUnrecoverable(ApiException e) {

public static boolean isNotFound(ApiException e) {
int code = e.getCode();
return code == 404 || code == 410;
return code == 404 || code == 410 || isStorageError(code, e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we want this specific 409 error to be handled the same as resource not found cases, it is probably cleaner if we introduced a new method, such as hasConflict, for this condition.

@ankedia ankedia marked this pull request as ready for review July 7, 2021 20:38
@ankedia ankedia changed the title OWLS-90614 - Handle ApiException with 409 code and "storage error" returned from the API call OWLS-90614 - Handle ApiException with 409 code returned from the replaceEvent API call Jul 7, 2021
Copy link
Member

@doxiao doxiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rjeberhard rjeberhard merged commit a47b428 into main Jul 8, 2021
@ankedia ankedia deleted the owls_90614 branch September 22, 2021 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants