fix(model): make model download pause race-safe - #497
Draft
Jinghao-coding wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文说明
背景
关联 Issue:Closes #472
模型下载任务在暂停请求与 Reconciler 检查之间存在竞态:Kubernetes Job 可能已被删除,但数据库状态仍未及时更新,导致暂停中的任务被错误标记为失败。
修改内容
Downloading状态可以转为Paused。Paused状态,再删除 Kubernetes Job。Paused状态时只清理 Job,不再根据 Job 状态覆盖数据库状态。Pending或Downloading任务标记为失败。验证
make lintgo vet ./pkg/reconciler ./internal/handlergit diff --check本地测试二进制未直接执行,因为测试初始化会连接当前配置的 PostgreSQL 环境;完整测试将由 CI 执行。
English Description
Background
Related issue: Closes #472
There is a race between a model download pause request and the Reconciler: the Kubernetes Job may already be deleted while the database state has not been updated, causing a paused download to be incorrectly marked as failed.
Changes
Downloadingdownloads can becomePaused.Pausedstate before deleting the Kubernetes Job.Pausedstate.PendingorDownloadingdownloads.Validation
make lintgo vet ./pkg/reconciler ./internal/handlergit diff --checkThe local test binaries were not executed because package initialization connects to the PostgreSQL environment configured for this checkout; the complete test suite will run in CI.