getPortLazy re-runs OS port discovery on every call when it finds no port

未关闭 适合新手
#5,606 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃

调研方向

首先定位 getPortLazy,并追踪它在哪里发现并缓存正在监听的端口;issue 未指定文件或测试。检查 #5601 的测试 resolver 如何处理端口发现,然后查看现有的、针对未检测到端口时重复调用的测试。完成标准是:在较短的 TTL 内重复调用时避免重新发现端口,同时在 TTL 过期后仍允许再次发现端口。

由索引模型根据 Issue 内容生成。

描述

Off Vercel, the runtime builds a run's URLs from the port its process listens on (getPortLazy), on every workflow replay and every step. When discovery finds no listening port, nothing is cached, so the next call asks the OS again: it reads /proc on Linux, spawns lsof on macOS and netstat on Windows (up to ~1s per call on a CI runner).

#5601 avoids this in the @workflow/core unit tests with a test resolver. A real process that runs steps without a detectable listening port, such as a separate worker, still pays it on every step. A short negative-cache TTL for the "no port" answer would bound the cost.

🤖 Generated with Claude Code

主要语言
TypeScript
星标
2.5k
派生
401
平均合并
1 天 21 小时
30 天内合并 PR
201

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vercel/workflow 的其他 Issue

查看 vercel/workflow 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。