Repository navigation
fix(datastore): apply timeout to every RPC config - #36733
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
The generated Datastore client sets a 60 s default per RPC, and that value is applied before the client-wide timeout, so Service#service never honored the timeout option. Copy the timeout to each RPC config, as Pub/Sub does.
pcbeingused333
requested review from
a team and
yoshi-approver
as code owners
November 18, 2026 02:53
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #36632
Google::Cloud::Datastore.new timeout: 5only set the client-wideconfig.timeout. The generatedgoogle-cloud-datastore-v1client defines a 60 s default for each RPC (rpcs.lookup,rpcs.commit,rpcs.allocate_ids, ...) and applies it first viaoptions.apply_defaults, which only fills empty values, so the client-wide timeout was never used and every request went out with 60 s.Service#servicenow copies the timeout into each RPC config through a smalloverride_client_config_timeoutshelper, the same approachgoogle-cloud-pubsubalready uses (#14405). When no timeout is given nothing changes.Test: new
test/google/cloud/datastore/service_test.rbchecks that withtimeout: 5the client config and every RPC config report 5, and that without a timeout the RPC defaults are untouched. It fails on main (lookupis 60.0) and passes with the change. The full datastore unit suite (280 runs) and rubocop on the touched files pass.AI assistance was used to investigate the issue, implement the patch, and write the test and this description.