Skip to content

Commit 57543c3

Browse files
authored
Fix/increas docker check timeout (alibaba#678)
* add release note 120 * Revert "add release note 120" This reverts commit 65a11fd. * increase docker check timeout
1 parent cf1c40f commit 57543c3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

rock/sandbox/sandbox_actor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,21 @@ async def start(self):
125125
try:
126126
await self._deployment.start()
127127
except Exception as ex:
128-
logger.error(f"start deployment failed: {ex}", exc_info=True)
128+
logger.error(f"[{self._config.container_name}] start deployment failed: {ex}", exc_info=True)
129129
raise ex
130130
if isinstance(self._deployment, DockerDeployment):
131131
self._clean_container_background()
132132
await self._setup_monitor()
133133

134134
async def stop(self):
135-
logger.info("start to stop")
135+
logger.info(f"[{self._config.container_name}] start to stop")
136136
try:
137137
await self._deployment.stop()
138-
logger.info("deployment stopped")
138+
logger.info(f"[{self._config.container_name}] deployment stopped")
139139
self._clean_container_background_process.kill()
140-
logger.info("actor stopped")
140+
logger.info(f"[{self._config.container_name}] actor stopped")
141141
except Exception as e:
142-
logger.error(f"Error occurred while stopping container: {e}", exc_info=True)
142+
logger.error(f"[{self._config.container_name}] Error occurred while stopping container: {e}", exc_info=True)
143143

144144
async def commit(self, image_tag: str, username: str, password: str) -> CommandResponse:
145145
logger.info(f"start to commit {self._config.container_name} to {image_tag}")
@@ -179,7 +179,7 @@ async def is_alive(self):
179179
try:
180180
return await self._deployment.is_alive()
181181
except Exception as e:
182-
logger.error(f"failed to check is alive: {e}", exc_info=True)
182+
logger.error(f"[{self._config.container_name}] failed to check is alive: {e}", exc_info=True)
183183
return IsAliveResponse(is_alive=False)
184184

185185
async def execute(self, command: Command) -> CommandResponse:

rock/utils/docker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class DockerUtil:
1010
@classmethod
1111
def is_docker_available(cls):
1212
try:
13-
result = subprocess.run(["docker", "--version"], capture_output=True, text=True, timeout=10)
13+
result = subprocess.run(["docker", "--version"], capture_output=True, text=True, timeout=30)
1414
if result.returncode == 0:
15-
result = subprocess.run(["docker", "info"], capture_output=True, text=True, timeout=10)
15+
result = subprocess.run(["docker", "info"], capture_output=True, text=True, timeout=30)
1616
return result.returncode == 0
1717
return False
1818
except (subprocess.TimeoutExpired, FileNotFoundError, OSError):

0 commit comments

Comments
 (0)