On Linux, a listener on all interfaces makes loopback allocation wait forever, blaming a lingering Harper node
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- linux, node.js, typescript
- 领域
- networking, testing-qa
调研方向
Start at getNextAvailableLoopbackAddress and trace how its canary bind failure leads to retries, then review the startHarper integration path and ForeignListenerError handling. Reproduce in a node:24-slim container with HARPER_INTEGRATION_TEST_LOOPBACK_POOL_COUNT=3 and a server on 0.0.0.0:9925; done means a covering listener raises ForeignListenerError instead of waiting indefinitely.
由索引模型根据 Issue 内容生成。
描述
On Linux, a process listening on all interfaces on a canary port (9925 or 9926), such as a local Harper instance running with its default config, makes getNextAvailableLoopbackAddress wait forever. The conflict canary's exclusive bind fails with EADDRINUSE on every pool address, because Linux refuses a specific-address bind beside a wildcard listener. The pool reads that as a lingering node, skips the address, and retries all of them every second with no deadline, printing a warning that blames the wrong thing.
Reproduction
In a node:24-slim container, with HARPER_INTEGRATION_TEST_LOOPBACK_POOL_COUNT=3, a private TMPDIR, and a plain Node server on 0.0.0.0:9925, getNextAvailableLoopbackAddress() was still pending after 6 s, having printed each of these six times:
[loopback-pool] 127.0.0.2 is still in use by another Harper node (port 9925 bound); skipping to avoid an SO_REUSEPORT co-bind.
[loopback-pool] 127.0.0.3 is still in use by another Harper node (port 9925 bound); skipping to avoid an SO_REUSEPORT co-bind.
[loopback-pool] 127.0.0.4 is still in use by another Harper node (port 9925 bound); skipping to avoid an SO_REUSEPORT co-bind.
A suite then hangs in startHarper until the test runner's own timeout.
Relation to #38
#38 is the macOS side of the same condition. There the bind canary passes beside a wildcard listener, and the suite silently talks to the other process. Its fix connect-probes the canary ports once the bind succeeds and throws ForeignListenerError. On Linux the bind fails first, so that check never runs, and this wait is unchanged by it.
Possible fix
When the canary's bind fails, tell a covering listener apart from a node on the address itself: try the same exclusive bind on a loopback address that no pool node uses. Linux routes all of 127.0.0.0/8 to lo, so, for example, 127.255.255.254 is bindable without aliases. If that bind conflicts too, a listener covers every address, and the pool can throw the same ForeignListenerError as on macOS instead of waiting.
- 主要语言
- TypeScript
- 星标
- 1
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
HarperFast/integration-testing 的其他 Issue
-
setupHarperWithFixture overwrites ctx.harper, dropping pre-set hostname (breaks multi-node add_node)未关闭
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
-
A listener on all interfaces silently receives a test node's connections on macOS; the conflict canary cannot see it可能已有人在做 @dawsontoth 于 3 天前认领。 未关闭
HarperFast/integration-testing#38 · 1 条评论 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 58/100
-
Detached Harper children are orphaned permanently when the runner dies by SIGKILL/SIGHUP — reap guard only covers exit/SIGINT/SIGTERM可能重新可做 @kriszyp 于 41 天前认领,目前没有进行中的 PR。 未关闭
HarperFast/integration-testing#29 · 1 条评论 · 已指派 1 人 ·
查看 HarperFast/integration-testing 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
siyuan-note/siyuan#20040 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
RunestoneInteractive/rs#1574 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
remotion-dev/remotion#11901 ·
维护者通常 1 天内回复
-
Poll constructor throws for an uncached channel while resolving a message context-menu interaction未关闭bug need repro packages:discord.js
难度 2/5 1-3 小时 新手友好度 82/100
discordjs/discord.js#11645 ·
维护者通常 3 天内回复
-
🐞 bug
难度 2/5 1-3 小时 新手友好度 72/100
Sitecore/content-sdk#641 ·
维护者通常 2 天内回复