Skip to content

[refactor][P3] Future.Wait(nil ctx) 直接 nil 接口 panic,未按簇内口径兜底 #98

Closed

Description

@zy84338719

来源:2026-11-11 全矩阵深度代码审查(6 路并行扫描约 24 万行 Go)。判定已复核;行号基于 2026-11-11 的 main,动手前请核对现场。
归档索引:#95(本仓重构 backlog)

位置

future.go:78-79

证据

select {
case <-ctx.Done():          // ctx == nil ⇒ nil interface 方法调用 panic
case <-f.done:
}

concurrency 的 retry/loop/syncx/breaker/Handle.WaitUpTo 全部「nil 按 Background」,Future 是 workflow 的导出结果句柄、Wait 是导出方法(嵌套流程把父 ctx 透传进来的调用链上 nil 会在更早处炸,但直调 Future 的消费方无防护)。

建议

Wait 入口补 if ctx == nil { ctx = context.Background() },与其余导出方法对齐;补一条 nil-ctx 直调测试(当前零覆盖)。

Activity

  1. added a commit that references this issue on Nov 11, 2026
  2. zy84338719 commented on Nov 11, 2026

    @zy84338719
    ContributorAuthor

    已在 v0.11.0 修复并发布 ✅

    变更内容

    本条修复(在 v0.11.0 的版本节里定位到):

    该版本 `v0.11.0` 的其余变更

    关联问题单:workflow#94、workflow#96、workflow#97、workflow#98、workflow#99。

    Release: https://github.com/oekit/workflow/releases/tag/v0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor重构机会(代码审查产出)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions