googleapis / googleapis/ruby-spanner
execute_sql hangs forever until you call .rows on the results
- Lingua principale
- Ruby
- Stelle
- 6
- Fork
- 24
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
#### Problem
When calling `execute_sql` the program hangs forever (I had to kill -9 it) unless you read from .rows.
#### Environment details
- OS: MacOS
- Ruby version: 3.4.2
- Gem name and version: google-cloud-spanner 2.26
#### Steps to reproduce
1. Create a client
2. `client.execute_sql`
3. Never read the result from `execute_sql`
4. Program hangs forever
#### Code example
```ruby
require "google/cloud/spanner"
puts "Starting"
emulator_host = ENV.fetch("SPANNER_EMULATOR_HOST", nil)
project_id = ENV.fetch("SPANNER_EMULATOR_PROJECT", "")
instance_id = ENV.fetch("SPANNER_EMULATOR_INSTANCE", "")
database_id = ENV.fetch("SPANNER_EMULATOR_DATABASE", "")
puts "Creating project"
project = Google::Cloud::Spanner.new(
project_id: project_id,
emulator_host: emulator_host,
)
puts "Creating client"
client = project.client(instance_id, database_id)
puts "Executing sql"
puts client.execute_sql("SELECT * FROM my_table")
```
Change the last line to:
`puts client.execute_sql("SELECT * FROM my_table").rows.first`
And it will no longer hang.
#### Full backtrace
There is no backtrace, the program just hangs forever after printing "Executing sql"
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia eseguendo la riproduzione Ruby fornita con l’emulatore Spanner e confronta execute_sql con execute_sql(...).rows.first. Segui il punto di ingresso client.execute_sql e la gestione del risultato per determinare perché il processo rimane attivo quando rows non viene mai letto. Il lavoro è completo quando la riproduzione termina senza richiedere una lettura da .rows, con copertura di regressione per entrambi gli utilizzi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ruby
- Ambito
- databases
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 38/100