Skip to content

Commit

Permalink
remote runtime tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww committed Nov 9, 2024
1 parent d7d905f commit 33c26a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openhands/runtime/impl/remote/remote_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ def _wait_until_alive(self):
f'Runtime (ID={self.runtime_id}) is not yet ready. Status: {pod_status}'
)

# Wait for pending status (until it changes)
while pod_status == 'Pending':
# Wait for pending status
while pod_status in ('Pending', 'Running'):
time.sleep(2)
runtime_info_response = self._send_request(
'GET',
Expand All @@ -314,7 +314,7 @@ def _wait_until_alive(self):
f'Runtime /alive failed to respond with 200: {e}'
)
return
if pod_status in ('Failed', 'Unknown'):
elif pod_status in ('Failed', 'Unknown'):
# clean up the runtime
self.close()
raise RuntimeError(
Expand All @@ -323,9 +323,9 @@ def _wait_until_alive(self):

self.log(
'debug',
f'Waiting for runtime pod to be active. Current status: {pod_status}',
f'Unexpected runtime pod status: {pod_status}',
)
raise RuntimeNotReadyError()
raise RuntimeError(f'Unexpected runtime pod status: {pod_status}')

def close(self, timeout: int = 10):
if self.config.sandbox.keep_remote_runtime_alive or self.attach_to_existing:
Expand Down

0 comments on commit 33c26a2

Please sign in to comment.