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

Graceful handling of ReadTimeoutExceptions #403

Merged
merged 2 commits into from
Sep 19, 2018

Conversation

sahilpalvia
Copy link
Contributor

Issue #, if available:
#399

Description of changes:

  • Emitting logging messages at DEBUG level for retryable exceptions
  • Introducing SubscribeToShardRetryableException

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

* Emitting logging messages at DEBUG level for retryable exceptions
* Introducing SubscribeToShardRetryableException
@sahilpalvia sahilpalvia added the v2.x Issues related to the 2.x version label Sep 18, 2018
@sahilpalvia sahilpalvia requested a review from pfifer September 18, 2018 23:53
Throwable current = t;
StringBuilder builder = new StringBuilder();
do {
if (current.getMessage() != null && current.getMessage().startsWith("Acquire operation")) {
return "AcquireTimeout";
return new ThrowableCategory(ThrowableType.ACUIRE_TIMEOUT);
Copy link
Contributor

Choose a reason for hiding this comment

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

These should just be static instances of the ThrowableCategory as they have no local state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed

import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these imports were added, but not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure why organize imports was ignored.

* Making private ThrowableCategory class static
* Creating static instances for acquiretimeout and readtimeout categories
* Cleaned up imports
* Renamed and moved SubscribeToShardRetryableException to RetryableRetrievalException
* Renamed UNKNOWN exception type to Other
@pfifer pfifer merged commit a893da6 into awslabs:master Sep 19, 2018
@pfifer pfifer added this to the v2.0.3 milestone Sep 19, 2018
@sahilpalvia sahilpalvia deleted the readtimeout-retry-fix branch September 19, 2018 17:23
@@ -184,29 +200,55 @@ private void handleFlowError(Throwable t) {
}
}

private String throwableCategory(Throwable t) {
private enum ThrowableType {
ACUIRE_TIMEOUT("AcquireTimeout"), READ_TIMEOUT("ReadTimeout"), OTHER("Other");
Copy link

Choose a reason for hiding this comment

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

Not that it matters too much, as it's private, but there's a typo here: ACUIRE_TIMEOUT -> ACQUIRE_TIMEOUT @sahilpalvia @pfifer

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for reporting this, we'll fix it in a later release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.x Issues related to the 2.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants