googleapis / googleapis/google-cloud-python
The application hangs after 30 minutes for long running PDML
- Ngôn ngữ chính
- Python
- Star
- 5.4k
- Fork
- 1.8k
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 122
Mô tả
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)
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.