Repository navigation
fix(project-backend): replace persistent control ports with dynamic endpoints - #1011
Merged
Merged
Conversation
wuzhiming
reviewed
Oct 26, 2026
wuzhiming
left a comment
Contributor
There was a problem hiding this comment.
未发现本次改动引入且有充分证据可确认的问题,仅完成静态审查,不代表测试通过。审查范围:三个文件的所提供 patch;对照 base 与 head 的 ownership.ts,并读取 head 的启动客户端、Launcher、所有权测试及相关测试辅助代码,核对并发发布、注册信息校验、监听器关闭和临时目录清理。无 patch 的相关文件仅用于验证调用关系,未作完整审查。未运行测试或构建,未实测 Windows、NTFS/exFAT 的目录重命名行为及真实后端集成;文档仅审查所提供差异。固定审查提交:18e3dce7,对照基线:e683ccc8。
PR 审查:#1011
审查提交:18e3dce7090adaf66c554fd1e6db8aa462f86b4e
Base:e683ccc80479aeda84365121f7bb5597f456c38f
验证范围:3 个变更文件,另读取 8 个提交内文件;静态审查,未运行构建或测试,未修改代码。
wuzhiming
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
PinK 0.0.2.0 fails to start a project on an exFAT drive because backend ownership acquisition publishes a persistent port registry using a hard link, which exFAT does not support. The reported failure is
EISDIRinProjectBackendLease.acquire.Bug report: https://forum.cocos.org/t/topic/177872/5?u=weijinda
Persisting a control port across restarts can also block normal startup when that port has subsequently been allocated to another project or application.
Implementation
rendezvous/port.jsonregistry and hard-link publication. Each backend startup binds127.0.0.1on port0, allowing the OS to allocate a currently available control port.owner.json. Discovery validates the live project and instance identity; missing, corrupt, unrelated, or unresponsive stale metadata does not pin a new startup to an old port.owner.jsonwrites cannot make a caller mistake another process for its own child.Behavior change: cross-process project exclusivity is no longer enforced. Independent startup commands may create separate backends for the same project; callers must coordinate concurrent project writes.
ensureProjectBackendreuses a discoverable backend and shares concurrent startup requests within the calling process. Old registry paths are neither read nor migrated.Testing
COCOS_BACKEND_TEST_TMPDIR=E:\. The Windows junction assertion is omitted when a custom test directory is configured.COCOS_TEST_PROJECT_BACKEND=1, covering startup, reuse, explicit shutdown, restart, and stale-descriptor handling.git diff --check.