yoshidan / google-cloud-rust

Google Cloud Client Libraries for Rust.
MIT License
222 stars 80 forks source link

Add timeout and connect timeout for spanner connections #165

Closed ivankelly closed 1 year ago

ivankelly commented 1 year ago

We encountered an issue with a broken spanner instance where when we connected the process just sat there doing nothing. Further investigation showed it was a server side problem. Other clients failed to connect also. But when the other clients failed they gave a error that the request to create sessions had timed out.

The rust client should do this also. I've added default timeouts for the spanner client based on the values in https://github.com/googleapis/google-cloud-go/blob/main/spanner/apiv1/spanner_client.go#L65 In the go client, some requests take a higher timeout, but the structure of the rust client doesn't allow this, so I set both defaults to 30s. Other users can increase, via channel_config, if they find this to be too low.

I didn't set defaults for pubsub as we don't use it.

yoshidan commented 1 year ago

Could you run cargo fmt to fix CI.

ivankelly commented 1 year ago

Done. I was sure I had run it before pushing :/

yoshidan commented 1 year ago

Thanks!