googleapis / googleapis/google-cloud-python

The application hangs after 30 minutes for long running PDML

未关闭
#15,925 5 条评论 0 个 reaction 已指派 1 人 已指派给 @harshachinta 在 GitHub 查看
api: spanner
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

There is an internal bug opened for this and potentially a fix in https://github.com/asthamohta/python-spanner/tree/retry-error. But it is not confirmed yet, so want to open this in github issue to track it and just in case it is not recorded.

No exception thrown up with following code using python google-cloud-spanner==3.19.0 running on GCE instance, the script just hangs after 30 minutes and the deletion stopped after 30 minutes

```
from google.cloud import spanner
from google.cloud.spanner_v1 import RequestOptions
import sys

def run(query: str, instance_id: str, database_id: str, project: str):
try:
spanner_client = spanner.Client(project=project)
database = spanner_client.instance(instance_id).database(database_id)
print(f"Connected to database {instance_id}/{database_id}")
print(f"Running query: {query}")
request_options = RequestOptions({"priority": RequestOptions.Priority.PRIORITY_HIGH,"transaction_tag": "delete transaction tag","request_tag": "delete request tag"})
row_ct = database.execute_partitioned_dml(query, request_options=request_options)
print(f"{row_ct} records updated.")
except Exception as e:
print(e)

if __name__ == "__main__":
query = sys.argv[4]
project = sys.argv[1]
instance = sys.argv[2]
database = sys.argv[3]
run(query, instance, database, project)
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。