Skip to content

Commit 2c97dd0

Browse files
committed
Try new fix
1 parent f1a54d1 commit 2c97dd0

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

pyfuse/worker/sandbox/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12-slim
1+
FROM python:3.13-slim
22

33
LABEL maintainer="pyfuse" \
44
description="pyfuse sandbox guest agent"

pyfuse/worker/sandbox/docker.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import shutil
2121
import asyncio
2222
import logging
23+
import contextlib
2324
from typing import Any
2425
from pathlib import Path
2526
from collections.abc import Callable
@@ -133,6 +134,11 @@ async def execute(
133134
f"Sandbox execution of '{function_name}' timed out "
134135
f"after {self.timeout}s"
135136
) from None
137+
except (asyncio.IncompleteReadError, ConnectionError, OSError) as exc:
138+
raise WorkerError(
139+
f"Sandbox connection lost while executing '{function_name}': "
140+
f"{type(exc).__name__}: {exc}"
141+
) from exc
136142

137143
if response["status"] == "error":
138144
raise WorkerError(
@@ -211,6 +217,8 @@ async def _wait_for_agent(self) -> None:
211217
timeout=2.0,
212218
)
213219
_w.close()
220+
with contextlib.suppress(ConnectionError, OSError):
221+
await _w.wait_closed()
214222
return
215223
except (OSError, asyncio.TimeoutError):
216224
await asyncio.sleep(1)

0 commit comments

Comments
 (0)