Skip to content

fix(tasks): 移除文件任务存储的统一 I/O 限流 - #6265

Merged
qin-ctx merged 1 commit into
volcengine:mainfrom
qin-ptr:fix/remove-task-store-io-main-ptr
Oct 19, 2026
Merged

qin-ctx merged 1 commit into
volcengine:mainfrom
qin-ptr:fix/remove-task-store-io-main-ptr

Conversation

@qin-ptr

@qin-ptr qin-ptr commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Description

移除 PersistentTaskStore 将文件读取、列目录、写入、建目录和删除共用的 8 并发限制,避免列表读取占满名额后阻塞任务状态写入。此 PR 基于 main 当前的 Task/Work 存储实现,承接 #6261 的优化目标。

同一个存储实例中,8 次列表查询正在等待任务文件读取,此时启动一个已经缓存的 pending 任务:

  • 修改前: 状态写入也需要取得共享名额,必须等待其中一次读取完成,任务继续显示 pending。
  • 修改后: 状态写入直接进入 AGFS,写入成功后发布 running 状态,不再等待这 8 次读取释放任务存储层的名额。

同一任务的串行更新,以及写入完成、发布缓存后再传播调用方取消的语义保持不变。

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

无关联 issue。对应已合入 hotfix 分支的 #6261;本 PR 按 main 当前的存储职责实现。

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • 删除 PersistentTaskStore._io、StoreIOLimiter 及内部构造参数 max_concurrent_io,各文件操作直接调用原有 run_to_completion。
  • 删除 TaskTracker 已经不生效的 max_concurrent_store_io 参数及现有测试中的参数传递。
  • 保留任务记录锁、业务键锁、清理锁、目录缺失重试和取消处理。
  • 删除 2 个限流专属测试,没有新增测试文件或测试场景。

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

以下现有测试共 99 个通过:

LITELLM_LOCAL_MODEL_COST_MAP=True python -m pytest -o addopts='' -q \
  tests/test_task_tracker_concurrency.py \
  tests/test_task_tracker.py \
  tests/test_task_backend_config.py \
  tests/service/test_task_work_contract.py \
  tests/server/test_compile_studio.py --tb=short

聚焦 A/B 复现使用真实 TaskTracker / PersistentTaskStore 和内存文件 fixture:让 8 次列表查询停在文件读取处,再启动已缓存的任务。基线在 500 ms 观察窗口内未完成状态写入;修改后在释放读取前完成,最终状态均为 running。这验证限流等待的消除,不是生产存储性能基准。

5 个改动文件的 Ruff check 和 git diff --check 通过。4 个文件的格式检查通过;tests/test_task_tracker_concurrency.py 在 main 基线已有同样的格式差异,本 PR 保留该处原样。

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

不适用。

Additional Notes

移除的是任务文件存储层的统一并发上限。底层存储及线程池仍可能排队;本 PR 不改变列表扫描方式,也不宣称解决生产环境全部延迟。

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
@qin-ctx
qin-ctx merged commit b727b81 into volcengine:main Oct 19, 2026
8 of 9 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Oct 19, 2026
hezhang-1216 pushed a commit that referenced this pull request Oct 29, 2026
Co-authored-by: qin-ptr <222410531+qin-ptr@users.noreply.github.com>
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants