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

Fix for Issue #1684 Changes in handleTimeoutCausedException in Timeou… #2220

Merged
merged 1 commit into from
Jan 4, 2021
Merged

Fix for Issue #1684 Changes in handleTimeoutCausedException in Timeou… #2220

merged 1 commit into from
Jan 4, 2021

Conversation

joviegas
Copy link
Contributor

@joviegas joviegas commented Dec 25, 2020

…tExceptionHandlingStage

Description

Some of the Retry attempts which failed due to the API TimeOuts did not successfully retried but ended up with AbortedException.

Motivation and Context

Refer Issue 1684

Root Cause

  • This is intermittent timing issue.
    -Occurs in below scenario
  1. ApiCallTimeoutTrackingStage Times out as its not getting the response. This Interrupts the thread.
  2. Request is still in progress but in some places we check the Thread interrupt status it then fails because the Thread is interrupted and throws Aborted Exception which is then thrown with SDKCLient Exception
  3. Now ApiCallTimeoutTrackingStage's handleInterruptedException resets the interrupt flag.
  4. And when the TimeoutExceptionHandlingStage resumes and tries to translatePipelineException() it fails to handle the exception because thread Interrupt is RESET and its SdkClientException (Hadled ones are InterruptedException, AbortedException, IOException)
  5. Thus fails to handle the Exception

Fix Options

  1. Do changes in ApiCallTimeoutTrackingStage's handleInterruptedException() not to clear the interrupt .
    Cons :- However this fix doesnot looks feasible since as per ApiCallTimeoutTrackingStage it rightly resets the Interrupt of the current Thread as part of had handleInterruptedException

  2. translatePipelineException of TimeoutExceptionHandlingStage should check (e.getCause instance of AbortedException)
    Cons :- We are getting too specifics to AbortedException and assuming that all the APIs fail with AbortedException whenever the request is aborted due to TimeOuts. So this looks we might miss some other exceptions or new exception added in future/

  3. In translatePipelineException check if the isCausedByApiCallAttemptTimeout and its SdkClientException
    Pros : This handles all the cases also in handleTimeoutCausedException we have if clauses which does the filtering.
    Cons : not aware.

Testing

  • Added Junits
  • Integ Test added and Integ Testing done

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@codecov-io
Copy link

codecov-io commented Dec 25, 2020

Codecov Report

Merging #2220 (518683e) into master (61f6c94) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2220      +/-   ##
============================================
+ Coverage     77.58%   77.61%   +0.03%     
  Complexity      335      335              
============================================
  Files          1230     1230              
  Lines         38697    38698       +1     
  Branches       3043     3044       +1     
============================================
+ Hits          30022    30035      +13     
+ Misses         7215     7202      -13     
- Partials       1460     1461       +1     
Flag Coverage Δ Complexity Δ
unittests 77.61% <100.00%> (+0.03%) 0.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...pipeline/stages/TimeoutExceptionHandlingStage.java 92.85% <100.00%> (+0.26%) 0.00 <0.00> (ø)
...ware/amazon/awssdk/utils/cache/CachedSupplier.java 87.80% <0.00%> (-2.44%) 0.00% <0.00%> (ø%)
...n/awssdk/codegen/poet/client/AsyncClientClass.java 92.30% <0.00%> (ø) 0.00% <0.00%> (ø%)
...ty/internal/IdleConnectionCountingChannelPool.java 86.58% <0.00%> (+1.21%) 0.00% <0.00%> (ø%)
...ntstream/EventStreamTaggedUnionJsonMarshaller.java 81.25% <0.00%> (+6.25%) 0.00% <0.00%> (ø%)
...ream/DefaultEventStreamResponseHandlerBuilder.java 56.52% <0.00%> (+8.69%) 0.00% <0.00%> (ø%)
.../awscore/client/handler/AwsClientHandlerUtils.java 89.83% <0.00%> (+15.25%) 0.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61f6c94...518683e. Read the comment docs.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 4, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@joviegas joviegas merged commit 885192e into aws:master Jan 4, 2021
aws-sdk-java-automation added a commit that referenced this pull request Oct 24, 2022
…809c69e0d

Pull request: release <- staging/8f1e1b34-59fb-48b4-a779-726809c69e0d
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