-
Notifications
You must be signed in to change notification settings - Fork 272
fix(amazonq): add retries for /transform APIs #5751
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
Conversation
private const val INITIAL_DELAY = 100L | ||
private const val MAX_BACKOFF = 10000L | ||
private const val MAX_RETRY_ATTEMPTS = 3 | ||
private const val MAX_ATTEMPTS = 4 |
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.
I'm guessing the intention was to do 3 retries (after the initial attempt), meaning this should technically be set to 4, and naming it MAX_ATTEMPTS
is more accurate.
is TimeoutException, | ||
is SocketTimeoutException, | ||
-> true | ||
else -> false |
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.
Following the same retry strategy from:
Lines 82 to 89 in ebece9d
isRetryable = { e -> | |
when (e) { | |
is ValidationException, | |
is ThrottlingException, | |
is SdkException, | |
is TimeoutException, | |
-> true | |
else -> false |
in the ExportResultArchive
(download) API
and added SocketTimeoutException
(which is not a type of TimeoutException
, so it needs to be explicitly listed here)
return@waitUntil state | ||
} catch (e: InvalidGrantException) { | ||
CodeTransformMessageListener.instance.onCheckAuth() | ||
CodeTransformMessageListener.instance.onReauthStarted() |
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.
This onCheckAuth
was disposing of our codeTransformationSessionContext
which doesn't make sense to do. Better to just initiate the onReauthStarted
flow which does:
Line 608 in ebece9d
* Invoking this is equivalent to user clicking "reauthenticate" in the Chat when credentials expired. |
instead of waiting/hoping for the user to click on the Re-authenticate button in the notification.
Types of changes
Description
Add back retries for /transform since they were being overridden to 0.
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.