googleapis / googleapis/google-cloud-python

The application hangs after 30 minutes for long running PDML

オープン
#15,925 コメント 5 件 リアクション 0 件 担当者 1 名 @harshachinta に割り当て済み GitHub で見る
api: spanner
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。