From 7248a863b07b1f1e9c4a2313a8e075ea22e3d215 Mon Sep 17 00:00:00 2001 From: Ray Myers Date: Fri, 24 Jan 2025 16:49:22 -0600 Subject: [PATCH] Log restart reason if runtime reports it --- openhands/runtime/impl/remote/remote_runtime.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openhands/runtime/impl/remote/remote_runtime.py b/openhands/runtime/impl/remote/remote_runtime.py index 79dfd3026d30..f0a9a7fb359d 100644 --- a/openhands/runtime/impl/remote/remote_runtime.py +++ b/openhands/runtime/impl/remote/remote_runtime.py @@ -306,6 +306,12 @@ def _wait_until_alive_impl(self): assert 'pod_status' in runtime_data pod_status = runtime_data['pod_status'].lower() self.log('debug', f'Pod status: {pod_status}') + restart_count = runtime_data.get('restart_count', 0) + if restart_count != 0: + restart_reasons = runtime_data.get('restart_reasons') + self.log( + 'debug', f'Pod restarts: {restart_count}, reasons: {restart_reasons}' + ) # FIXME: We should fix it at the backend of /start endpoint, make sure # the pod is created before returning the response.