googleapis / googleapis/google-cloud-python

The application hangs after 30 minutes for long running PDML

Abierto
#15,925 5 comentarios 0 reacciones 1 asignado Asignado a @harshachinta Ver en GitHub
api: spanner
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

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)
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.