sdk-codegen icon indicating copy to clipboard operation
sdk-codegen copied to clipboard

GO SDK runtime does not use the timeout passed in the API call

Open panoskoug opened this issue 4 years ago • 4 comments

All the API calls in the GO mapping take an argument rtl.ApiSettings that contains a timeout. However, when I inspect the code it looks that the argument is not consulted, instead the default/initial setting is used. The code that needs to be change is around here.

panoskoug avatar Jun 10 '21 19:06 panoskoug

@jkaster What do you think of us deprecating rtl.ApiSettings for Go SDK? It deviates from our established ways to configure an SDK, either with environment variables or looker.ini.

jeremytchang avatar Mar 16 '22 22:03 jeremytchang

@panoskoug There are 2 established ways for configuring the Go SDK for now. You can do it through env variables or looker.ini. Are you using rtl.ApiSettings in some way that cannot be done with the existing ways to config?

jeremytchang avatar Mar 16 '22 22:03 jeremytchang

The API settings argument is the "transport options" on some of the other SDKs. The TypeScript SDK is our reference pattern implementation (almost all changes and features are seen first there). In the TypeScript SDK, the timeout parameter in the optional options argument is used to override the default HTTP request timeout for a specific SDK method call. The Go SDK needs to implement that for design/feature parity with the other SDKs. That way SDK users can knowingly pass in a timeout override for an API call they know will timeout with the default value.

jkaster avatar Mar 17 '22 00:03 jkaster

@jeremytchang my use case is calling the API from a multi threaded service serving RPCs. We need to be able to control the timeout per RPC so any global per process settings are not adequate.

panoskoug avatar Mar 17 '22 15:03 panoskoug

Fix here: https://github.com/looker-open-source/sdk-codegen/pull/1287

jeremytchang avatar Mar 28 '23 21:03 jeremytchang