【发布时间】:2020-12-14 11:17:48
【问题描述】:
我正在尝试使用 AWS rds-data api 在 aurora Serverless Postgresql 中执行一些繁重的 etl。
根据AWS Rds DATA 文档,By default, a call times out if it's not finished processing within 45 seconds. However, you can continue running a SQL statement if the call times out by using the continueAfterTimeout parameter.
我看到boto3 rds-data 支持 continueAfterTimeout 参数(一个布尔值)。 我可以在这样的交易中使用这个标志。
def execute_transaction_query(sql, transaction_id):
print(sql)
response = rds_client.execute_statement(
secretArn=AURORA_DB_CREDS_ARN,
resourceArn=AURORA_DB_ARN,
database=AURORA_DB_NAME,
sql=sql,
transactionId=transaction_id,
continueAfterTimeout=True, # boolean flag to continue after timeout in theory
)
但是,查询在 45 秒后仍然失败并出现错误
An error occurred (StatementTimeoutException) when calling the ExecuteStatement operation: Request timed out
【问题讨论】:
标签: amazon-web-services amazon-aurora aws-rds-data-service