-
Notifications
You must be signed in to change notification settings - Fork 467
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
Conversation
* Emitting logging messages at DEBUG level for retryable exceptions * Introducing SubscribeToShardRetryableException
...is-client/src/main/java/software/amazon/kinesis/retrieval/fanout/FanOutRecordsPublisher.java
Outdated
Show resolved
Hide resolved
...is-client/src/main/java/software/amazon/kinesis/retrieval/fanout/FanOutRecordsPublisher.java
Outdated
Show resolved
Hide resolved
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
...c/main/java/software/amazon/kinesis/retrieval/fanout/SubscribeToShardRetryableException.java
Outdated
Show resolved
Hide resolved
import lombok.RequiredArgsConstructor; | ||
import lombok.experimental.Accessors; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@@ -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"); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Issue #, if available:
#399
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.