Skip to content

跟踪上游 PR #24783: Windows child process close hang 修复 #2

Description

@bingkxu

关联上游 PR

问题描述

Windows 上,当子进程创建孙进程(如 hvigor/Gradle daemon)时,孙进程可能继承 stdout/stderr 管道句柄。即使直接子进程退出,继承的句柄仍保持管道打开,导致 Node.js close 事件无法触发。

cross-spawn-spawner.ts 中的 exitCode 仅在 close 事件中 resolve,导致 bash 工具在 Effect.raceAll 中无限等待。

修复方案

添加 exit 事件回退:在 exit 事件中延迟 2 秒后 resolve exitCode。如果 close 在 2 秒内触发(正常情况),行为不变;如果 close 未触发(daemon 持有管道),2 秒后回退 resolve。

跟踪状态

  • PR 合入上游
  • 同步到本地分支
  • 验证修复效果

更新日志

创建 issue,跟踪 PR anomalyco#24783

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions