Skip to content

Commit 994641d

Browse files
qingyupppclaude
andcommitted
fix(k8s): replace blocking time.sleep with asyncio.sleep in _wait_for_sandbox_ready
When the workload is not yet visible after creation, the polling loop fell into a time.sleep branch instead of await asyncio.sleep. This blocked the event loop during sandbox creation, preventing FastAPI from handling other requests (including /health), which could cause liveness probe failures and pod restarts. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent d14932e commit 994641d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/opensandbox_server/services/k8s/kubernetes_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async def _wait_for_sandbox_ready(
196196

197197
if not workload:
198198
logger.debug(f"Workload not found yet for sandbox {sandbox_id}")
199-
time.sleep(poll_interval_seconds)
199+
await asyncio.sleep(poll_interval_seconds)
200200
continue
201201

202202
status_info = _normalize_create_status(

0 commit comments

Comments
 (0)