agentscope-ai / agentscope-ai/agentscope-runtime

Intermittent Runtime Service Container Start Timeout (60s) — Filesystem Sandbox on K8s

未關閉
#520 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
Python
星號
863
分支
168
PR 合併指標
30 天內沒有已合併 PR

描述

## Bug Report: Intermittent Runtime Service Container Start Timeout (60s) — Filesystem Sandbox on K8s

### Description

When invoking `call_tool` through the sandbox manager in a **Kubernetes deployment** using the **filesystem sandbox image**, the runtime service intermittently fails to start within the default 60-second timeout, causing a `TimeoutError`. The container is created but the FastAPI service inside it does not become ready in time. This issue is **non-deterministic** — the same workflow may succeed on retry.

### Error Log

```
2026-06-23 00:01:30 - ERROR - [agentscope_runtime.sandbox.manager.server.app] Error in call_tool: Runtime service did not start within the specified timeout. container=agent-runtime-container-43i5rt85iuj4xhqimz3fg31lw, timeout=60s, elapsed=60s, session_ctx_id=None, base_url=http://10.58.8.197:30760/fastapi, stack_trace=NoneType: None

Call stack:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 176, in endpoint
result = await asyncio.to_thread(method, **data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: Runtime service did not start within the specified timeout. container=agent-runtime-container-43i5rt85iuj4xhqimz3fg31lw, timeout=60s, elapsed=60s, session_ctx_id=None, base_url=http://10.58.8.197:30760/fastapi, stack_trace=NoneType: None
```

### Steps to Reproduce

1. Deploy the sandbox manager in a Kubernetes cluster using the filesystem sandbox image.
2. Trigger a `call_tool` request that requires starting a new runtime container.
3. Wait for the container to start and the FastAPI service to become healthy.
4. The request **intermittently** times out after 60 seconds with the error above. Retrying may succeed without any changes.

### Expected Behavior

The runtime container should start and the FastAPI service should become ready within the 60-second timeout window, allowing `call_tool` to proceed normally.

### Actual Behavior

The container is created, but the FastAPI service at `http://10.58.8.197:30760/fastapi` does not respond within 60 seconds. The timeout is exactly 60s (`elapsed=60s`), suggesting the health check never succeeds.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。