Skip to content

fix: execution_domain::schedule_execution() 偶发 get 到空 hashmap guard#6

Open
pointertobios wants to merge 2 commits into
mainfrom
fix/I-5
Open

fix: execution_domain::schedule_execution() 偶发 get 到空 hashmap guard#6
pointertobios wants to merge 2 commits into
mainfrom
fix/I-5

Conversation

@pointertobios

Copy link
Copy Markdown
Owner

改动概述

Closes #5

改动类型

fix

AI 使用披露

本次改动中,AI 参与了哪些部分:

  • 未使用 AI
  • 文档润色
  • 测试样例草拟
  • 非核心样板代码生成
  • 核心逻辑草案或实现建议
  • 重构建议、命名建议或 review 辅助
  • 风险分析、边界条件整理或说明文字撰写

Copilot AI review requested due to automatic review settings May 6, 2026 01:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 旨在修复 execution_domain::schedule_execution() 偶发拿到空 hash_map guard(m_executions.get(id) 为空)的问题,整体方向是在 execution 结束/脱离时更彻底地清理调度器侧的状态,避免后续调度或唤醒再命中已脱离的 execution。

Changes:

  • 调整 worker::run_once() 在 execution 结束时的清理顺序(domain/scheduler 的 detach 调用顺序变更)。
  • dynprio_scheduler::detach_suspended_execution() 增加对 m_preawake_executions 的清理。
  • cycle_scheduler 增强 detach/awake/suspend 路径对 preawaken/detached 的处理,并尝试清理 index 映射。

注意:改动涉及 asco/core 的并发/调度/生命周期语义路径;请不要仅依赖本 review 的结论,务必由作者自行逐路径核对不变量、失败路径与竞态窗口(尤其是 wake 传递与 detach 时序)。

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
asco/core/worker.cpp 调整 execution 结束后的 domain/scheduler 清理调用顺序。
asco/core/task/dynprio_scheduler.cpp detach 时额外清理 preawake 集合以减少脏唤醒残留。
asco/core/task/cycle_scheduler.h 修正/增强 detached & preawaken 相关状态处理,并尝试同步清理索引映射。

Comment thread asco/core/worker.cpp Outdated
Comment thread asco/core/task/dynprio_scheduler.cpp
Comment thread asco/core/task/cycle_scheduler.h
Comment thread asco/core/task/cycle_scheduler.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

execution_domain::schedule_execution() 偶发 get 到空 hashmap guard

2 participants