fix(smithy_aws): Retry transient transport failures (AWSHttpException) - #7263
fix(smithy_aws): Retry transient transport failures (AWSHttpException)#7263VarshithaPamisetty wants to merge 7 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7263 +/- ##
==========================================
+ Coverage 40.97% 40.98% +0.01%
==========================================
Files 121 121
Lines 8273 8273
Branches 3598 3598
==========================================
+ Hits 3390 3391 +1
+ Misses 4883 4882 -1 🚀 New features to boost your workflow:
|
| // Transport-level failures never reached the server, so are safe to retry. | ||
| if (exception is AWSHttpException) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Are you sure that this is always transport-level? I see these two exceptions:
- https://github.com/aws-amplify/amplify-flutter/blob/df9817b091e42323a4050fd00b7702d3323126b9/packages/common/amplify_db_common_dart/lib/src/connect_html.dart#L74L80
- https://github.com/aws-amplify/amplify-flutter/blob/df9817b091e42323a4050fd00b7702d3323126b9/packages/common/amplify_db_common_dart/lib/src/connect_html.dart#L62L66
Should we e.g. check the exception? See if we see specific HTTP codes? We could have a look at the actual exception we want to retry.
There was a problem hiding this comment.
Good point. AWSHttpException has no status code so we can't check codes, and those two are response errors, not transport. Instead of trusting the type, the HTTP client now marks the real transport failures with AWSHttpException.retryable(...) and the retryer only retries the flagged ones, so those two stay non-retryable.
Should we check the HTTP code before setting the exception to retryable? Or even catch more fine granular?
Description
AWSRetryerdidn't retry transient transport failures (dropped handshakes, connection resets), which surface asAWSHttpException. The HTTP client now marks these as retryable viaAWSHttpException.retryable(...), and the retryer retries only those.Tests
aws_commontest: the client flags a failed connection as retryable.dart analyze/formatclean.