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

rds-data: Retry does not work with DatabaseResumingException in Serverless V2 #6701

Open
2 tasks
yukihato opened this issue Nov 28, 2024 · 1 comment
Open
2 tasks
Assignees
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@yukihato
Copy link

Describe the feature

In Serverless v2, DatabaseResumingException occurs when ACU is 0 in auto-pause state, but retry does not work.
It is clear that the system will start up in a few seconds, so I want the retry to be performed.

Below is a sample code and log.

import {
    RDSDataClient,
    BeginTransactionCommand,
} from '@aws-sdk/client-rds-data'
const RDS = new RDSDataClient({
    maxAttempts: 10,
})
result = await RDS.send(
    new BeginTransactionCommand({
        resourceArn: ****,
        secretArn: ****,
        database: ****,
    })
)
"error": {
    "name": "DatabaseResumingException",
    "$fault": "client",
    "$metadata": {
        "httpStatusCode": 400,
        "requestId": "***",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "message": "The Aurora DB instance arn:**** is resuming after being auto-paused. Please wait a few seconds and try again."
}

Use Case

In Serverless v2, if auto-pause is enabled

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

@aws-sdk/client-rds-data: 3.699.0

Environment details (OS name and version, etc.)

Node 22

@yukihato yukihato added feature-request New feature or enhancement. May require GitHub community feedback. needs-triage This issue or PR still needs to be triaged. labels Nov 28, 2024
@RanVaknin
Copy link
Contributor

Hi @yukihato ,

The SDK will only retry errors that are considered Retryable. Since 400 errors are not considered retryable the SDK wont retry this operation regardless of how many maxAttempts you have configured.

In your case you will need to implement your own retryer logic to retry on this specific DatabaseResumingException error.
Please refer to our supplemental docs for a code example.

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this Dec 6, 2024
@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants