Skip to content

fix(datastore): apply timeout to every RPC config - #36733

Open
pcbeingused333 wants to merge 1 commit into
googleapis:mainfrom
pcbeingused333:fix/datastore-propagate-timeout
Open

pcbeingused333 wants to merge 1 commit into
googleapis:mainfrom
pcbeingused333:fix/datastore-propagate-timeout

Conversation

@pcbeingused333

Copy link
Copy Markdown

Fixes #36632

Google::Cloud::Datastore.new timeout: 5 only set the client-wide config.timeout. The generated google-cloud-datastore-v1 client defines a 60 s default for each RPC (rpcs.lookup, rpcs.commit, rpcs.allocate_ids, ...) and applies it first via options.apply_defaults, which only fills empty values, so the client-wide timeout was never used and every request went out with 60 s.

Service#service now copies the timeout into each RPC config through a small override_client_config_timeouts helper, the same approach google-cloud-pubsub already uses (#14405). When no timeout is given nothing changes.

Test: new test/google/cloud/datastore/service_test.rb checks that with timeout: 5 the client config and every RPC config report 5, and that without a timeout the RPC defaults are untouched. It fails on main (lookup is 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.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google-cloud-datastore] timeout option has no effect: per-RPC defaults override it (same as #14050)

1 participant