[google-cloud-datastore] timeout option has no effect: per-RPC defaults override it (same as #14050)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
The timeout option documented in OVERVIEW.md ("Configuring timeout") is accepted by Google::Cloud::Datastore.new but never applied to requests. Every RPC is sent with the 60 s RPC-specific default from google-cloud-datastore-v1.
This is the same problem reported for Pub/Sub in #14050 and fixed there in #14405 ("Propagate timeout to client RPC configs"). The Datastore library didn't get the equivalent change.
Environment details
- OS: macOS
- Ruby version: 3.4.9
- Gem name and version: google-cloud-datastore 2.14.0, google-cloud-datastore-v1 1.6.0, gapic-common 1.3.0
The code involved is unchanged on main.
Steps to reproduce
- Create a dataset with
timeout: 5. - Make any request.
- The request is sent with a 60 s timeout, not 5 s.
Code example
require "google/cloud/datastore"
ENV["DATASTORE_EMULATOR_HOST"] = "localhost:8081" # no server needed; the RPC is intercepted
datastore = Google::Cloud::Datastore.new project_id: "my-project", timeout: 5
client = datastore.service.service # Google::Cloud::Datastore::V1::Datastore::Client
puts "client config.timeout: #{client.configure.timeout.inspect}"
puts "client config.rpcs.commit: #{client.configure.rpcs.commit.timeout.inspect}"
stub = client.instance_variable_get :@datastore_stub
stub.define_singleton_method :call_rpc do |method, _request, options:|
puts "#{method} sent with timeout: #{options.timeout.inspect}"
raise "stop"
end
[-> { datastore.save datastore.entity("Task", "a") },
-> { datastore.find "Task", "a" },
-> { datastore.allocate_ids datastore.key("Task"), 1 }].each do |call|
call.call
rescue StandardError
nil
end
Output:
client config.timeout: 5
client config.rpcs.commit: 60.0
commit sent with timeout: 60.0
lookup sent with timeout: 60.0
allocate_ids sent with timeout: 60.0
Cause
Google::Cloud::Datastore::Service#service sets only the client-wide config.timeout (service.rb:48). The generated client sets rpcs.<rpc>.timeout = 60.0 for every Datastore RPC and applies it first:
options.apply_defaults timeout: @config.rpcs.lookup.timeout, ... # 60.0
options.apply_defaults timeout: @config.timeout, ... # 5
Gapic::CallOptions#apply_defaults only fills an empty value (@timeout ||= timeout), so the client-wide timeout is never used.
Suggested fix
Apply the same change as #14405 to google-cloud-datastore: when a timeout is given, copy it to each config.rpcs.*.timeout in Service#service. Failing that, update OVERVIEW.md to say the option has no effect and document the per-RPC workaround (Google::Cloud::Datastore::V1::Datastore::Client.configure { |c| c.rpcs.commit.timeout = ... }).
- Langage dominant
- Ruby
- Étoiles
- 1.4k
- Forks
- 581
- Merge moyen
- 1 j 22 h
- PR mergées (30 j)
- 69
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de googleapis/google-cloud-ruby
-
eMudhra/emSign CA compromise (October 2026): what Cloud SDK Ruby Libraries developers need to doPeut-être pris @viacheslav-rostovtsev l’a pris il y a 14 jours. Ouvertetype: process
googleapis/google-cloud-ruby#36690 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
chore(ci): remove temporary Windows grpc < 1.85.0 pin once x64-mingw-ucrt gem is publishedPeut-être pris @viacheslav-rostovtsev l’a pris il y a 21 jours. Ouvertegrpc priority: p1 type: cleanup
googleapis/google-cloud-ruby#36677 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
storage/bigquery: google-apis-* dependency floors are lower than the wrappers actually requirePeut-être à nouveau libre @kalragauri l’a pris il y a 34 jours, et aucune pull request n’est ouverte. Ouverteapi: storage priority: p3 type: bug
googleapis/google-cloud-ruby#36610 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Support `STORAGE_EMULATOR_HOST` in the `google-cloud-storage` GemPeut-être pris @rajeevpodar l’a pris il y a 39 jours. Ouverteapi: storage priority: p2 type: feature request
googleapis/google-cloud-ruby#34022 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Google::Cloud::Error Events - Stream error in the HTTP/2 framing layer (Google::Cloud::Error)Peut-être à nouveau libre @rajeevpodar l’a pris il y a 39 jours, et aucune pull request n’est ouverte. Ouverteapi: storage priority: p2 type: bug
googleapis/google-cloud-ruby#33451 · 1 commentaire · 1 réaction · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de googleapis/google-cloud-ruby
Issues similaires
-
Payment details dialog shows "Did not pass" for AVS/CVV results that mean the check wasn't performedOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
autonome
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
demarche-numerique/demarche.numerique.gouv.fr#14566 ·
Les mainteneurs répondent en général sous 1 jour
-
Home link is now tinyOuvertearea/web interface
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
mastodon/mastodon#41723 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
akitaonrails/ai-book-2026#15 ·