-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
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
- Create a client
client.execute_sql- Never read the result from
execute_sql - Program hangs forever
Code example
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"
Metadata
Metadata
Assignees
Labels
No labels