googleapis / googleapis/google-cloud-python
The application hangs after 30 minutes for long running PDML
- Langage dominant
- Python
- Étoiles
- 5.4k
- Forks
- 1.8k
- Merge moyen
- 3 j 4 h
- PR mergées (30 j)
- 122
Description
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)
```
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.