Closed jacek-jablonski closed 6 years ago
LGTM
Thanks!
@jacekjab Do you think maybe we should set the default to some conservative number instead of None by default? My guess is that there aren't any admin operations that take very long. Maybe 6 seconds?
On a large cluster, admin operations to list things CAN take a long time. Listing metadata (see my PR) can be very slow. I consider this partially a problematic design choice: some operations simply cannot be made faster, but an HTTP API doesn't provide a good way to do callbacks, so you're stuck with polling for completion instead.
@liammonahan as @robbat2 mentioned some metadata requests can take very long time. So as for me conservative number is rather 120 seconds.
That's for the context @jacekjab and @robbat2 I think it's hard to pick what the perfect number would be in this case, so I'm thinking we keep it as is in the PR and let the caller have the ability to specify the timeout without providing one explicitly.
Currently requests have no timeout (by default in requests lib). Hanged RGWs may keep REST API tasks running unnecessarily long. Adding timeout prevents such situations.