Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(eval): Increase RemoteRuntime request timeouts to cope with busy cluster (#5671)

Xingyao Wang8983eb4cc18b
diff --git a/openhands/runtime/impl/remote/remote_runtime.py b/openhands/runtime/impl/remote/remote_runtime.py
index a1114c4ed9..ab3aac4ec9 100644
--- a/openhands/runtime/impl/remote/remote_runtime.py
+++ b/openhands/runtime/impl/remote/remote_runtime.py
@@ -149,7 +149,7 @@ class RemoteRuntime(Runtime):
'GET',
f'{self.config.sandbox.remote_runtime_api_url}/sessions/{self.sid}',
is_retry=False,
- timeout=30,
+ timeout=60,
) as response:
data = response.json()
status = data.get('status')
@@ -180,7 +180,7 @@ class RemoteRuntime(Runtime):
'GET',
f'{self.config.sandbox.remote_runtime_api_url}/registry_prefix',
is_retry=False,
- timeout=10,
+ timeout=60,
) as response:
response_json = response.json()
registry_prefix = response_json['registry_prefix']
@@ -212,7 +212,7 @@ class RemoteRuntime(Runtime):
f'{self.config.sandbox.remote_runtime_api_url}/image_exists',
is_retry=False,
params={'image': self.container_image},
- timeout=10,
+ timeout=60,
) as response:
if not response.json()['exists']:
raise RuntimeError(
@@ -253,6 +253,7 @@ class RemoteRuntime(Runtime):
f'{self.config.sandbox.remote_runtime_api_url}/start',
is_retry=False,
json=start_request,
+ timeout=60,
) as response:
self._parse_runtime_response(response)
self.log(
@@ -269,7 +270,7 @@ class RemoteRuntime(Runtime):
f'{self.config.sandbox.remote_runtime_api_url}/resume',
is_retry=False,
json={'runtime_id': self.runtime_id},
- timeout=30,
+ timeout=60,
):
pass
self.log('debug', 'Runtime resumed.')
@@ -294,7 +295,7 @@ class RemoteRuntime(Runtime):
with self._send_request(
'GET',
f'{self.runtime_url}/vscode/connection_token',
- timeout=10,
+ timeout=60,
) as response:
response_json = response.json()
assert isinstance(response_json, dict)
@@ -331,6 +332,7 @@ class RemoteRuntime(Runtime):
with self._send_request(
'GET',
f'{self.config.sandbox.remote_runtime_api_url}/sessions/{self.sid}',
+ timeout=60,
) as runtime_info_response:
runtime_data = runtime_info_response.json()
assert 'runtime_id' in runtime_data
@@ -347,6 +349,7 @@ class RemoteRuntime(Runtime):
with self._send_request(
'GET',
f'{self.runtime_url}/alive',
+ timeout=60,
): # will raise exception if we don't get 200 back.
pass
except requests.HTTPError as e: