external: add timeout to rgw admin ops api request
The rgw endpoint validation issued an HTTP request to the admin ops api without a timeout. If the RGW is accepting connections but slow to respond, for example right after the object store was created, the script hangs indefinitely instead of reporting a validation error that the caller could retry on. Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
This commit is contained in:
1 parent
a8398f9996
commit
459c4bebe9
1 file changed
+2
@@ -1432,10 +1432,12 @@ class RadosJSON:
|
||||
request_url = base_url + urlencode(params)
|
||||
|
||||
try:
|
||||
# requests.get without a timeout could hang forever on an unresponsive endpoint
|
||||
r = requests.get(
|
||||
request_url,
|
||||
auth=S3Auth(access_key, secret_key, rgw_endpoint),
|
||||
verify=verify,
|
||||
timeout=30,
|
||||
)
|
||||
except requests.exceptions.Timeout:
|
||||
sys.stderr.write(
|
||||
|
||||
Reference in new issue
Block a user