From 21967859797717e936798ca1de71c297f98d4178 Mon Sep 17 00:00:00 2001 From: jiaoliao Date: Thu, 5 Feb 2026 07:01:24 +0000 Subject: [PATCH] fix scheduler task file not found detection --- .../version-1.2.x/Release Notes/index.md | 3 ++- .../version-1.2.x/Release Notes/v1.2.1.md | 17 +++++++++++++++++ .../version-1.2.x/Release Notes/index.md | 1 + .../version-1.2.x/Release Notes/v1.2.1.md | 17 +++++++++++++++++ pyproject.toml | 2 +- rock/admin/scheduler/task_base.py | 7 +++---- uv.lock | 2 +- 7 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.1.md create mode 100644 docs/versioned_docs/version-1.2.x/Release Notes/v1.2.1.md diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/index.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/index.md index 474503cad..75cd7b884 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/index.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/index.md @@ -2,4 +2,5 @@ sidebar_position: 1 --- # 版本说明 -* [release v1.2.0](v1.2.0.md) \ No newline at end of file +* [release v1.2.0](v1.2.0.md) +* [release v1.2.1](v1.2.1.md) diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.1.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.1.md new file mode 100644 index 000000000..628ab6a7a --- /dev/null +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.1.md @@ -0,0 +1,17 @@ +# v1.2.1 + +## 发布日期 +2026 年 2 月 5 日 + +## 概述 +本次发布主要涉及Admin的bug修复。 + +--- + +## Admin + +### Bug 修复 + +#### 任务调度器 + +修复了任务状态文件在worker中缺失检测不到的问题。 diff --git a/docs/versioned_docs/version-1.2.x/Release Notes/index.md b/docs/versioned_docs/version-1.2.x/Release Notes/index.md index 27d56c625..bf2c85834 100644 --- a/docs/versioned_docs/version-1.2.x/Release Notes/index.md +++ b/docs/versioned_docs/version-1.2.x/Release Notes/index.md @@ -3,3 +3,4 @@ sidebar_position: 1 --- # Release Notes * [release v1.2.0](v1.2.0.md) +* [release v1.2.1](v1.2.1.md) diff --git a/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.1.md b/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.1.md new file mode 100644 index 000000000..dc3b55b59 --- /dev/null +++ b/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.1.md @@ -0,0 +1,17 @@ +# v1.2.1 + +## Release Date +February 5, 2026 + +## Overview +This release primarily focuses on Admin bug fix. + +--- + +## Admin + +### Bug Fixes + +#### Task Scheduler + +Fix an issue where missing task status files on workers were not detected. diff --git a/pyproject.toml b/pyproject.toml index 0cd20bb53..df37f7c5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" authors = [{ name = "chatos@alibaba" }] requires-python = "<4.0,>=3.10" name = "rl-rock" -version = "1.2.0" +version = "1.2.1" description = "ROCK-Reinforcement Open Construction Kit" readme = "README.md" dependencies = [ diff --git a/rock/admin/scheduler/task_base.py b/rock/admin/scheduler/task_base.py index cde082872..6fc7bdfac 100644 --- a/rock/admin/scheduler/task_base.py +++ b/rock/admin/scheduler/task_base.py @@ -151,10 +151,9 @@ async def single_run(self, runtime: RemoteSandboxRuntime, ip: str) -> dict: async def get_task_status(self, runtime: RemoteSandboxRuntime) -> TaskStatus | None: """Get task status from worker.""" - try: - await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True)) - except Exception: - logger.info(f"{self.status_file_path} not found") + check_file_resp = await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True)) + if check_file_resp.exit_code == 2: + logger.info(f"task status file not exist: {self.status_file_path}") return None response = await runtime.read_file(ReadFileRequest(path=self.status_file_path)) diff --git a/uv.lock b/uv.lock index fbef1e517..86b59acd9 100644 --- a/uv.lock +++ b/uv.lock @@ -4011,7 +4011,7 @@ wheels = [ [[package]] name = "rl-rock" -version = "1.0.2" +version = "1.2.1" source = { editable = "." } dependencies = [ { name = "anyio" },