Repository navigation
test(authority): prevent read consumer pipe EOF stalls - #7463
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max
动机 / Motivation
运行完整控制面并发回归的贡献者。五种存储与传输夹具的20项完整消费者测试通过。不改变产品行为、权限、图规模或原有90秒门槛。
完整控制面并发回归有时等待90秒后失败。私有诊断堆栈明确停在Python的json.load(sys.stdin)读取阶段,尚未进入投影、存储或任何LoopX效果。原完整套件在不同轮次分别影响PostgreSQL和SQLite;单例和四消费者基线正常,因此不能把它归因给数据库或用延长时限掩盖。本次修复两组测试的输入传输,使既有完整图政策重新获得可靠反馈。产品行为与用户操作不变,也不宣称整版发布已经通过。
改动思路 / Approach
保留同一JSON、同一标准输入接口和原Python程序,只把同步管道输入改为有确定EOF的临时普通文件描述符。临时文件的编码仍为UTF-8,完整todos/cases没有裁剪,timeout仍为90,000毫秒。相比给命令行拼接整张图,文件不引入跨平台参数长度上限;相比分别复制准备逻辑,共享helper只管理这两个现有调用方的资源生命周期。没有新增重试、假成功或Python决策owner。
具体改动 / Changes
规格依据是docs/development/good-smokes.md,spec_revision=27991e27ba998439d7faf2fc113efcfe82882144:固定版本。REAL-CONSUMER implemented:原跨语言生产消费者和既有存储均真实执行;INDEPENDENT-ORACLE implemented:缺失/self successor、handoff、peer过滤和整份authority不变断言保留;OWNED-FIXTURE implemented:合成JSON只存在于当前调用的临时目录,descriptor与目录由finally清理。三项均在当前精确head 24d6e657339055610792a749c9ec7a9c90494001核对。
关键代码讲解
- runPythonReadConsumer 将完整source序列化一次,文件以只读descriptor交给Python stdin;内层finally关闭descriptor,外层finally删除目录,子进程非零或超时也走相同清理。解释器仍由原resolveTestPython选择。
- succession readback 只替换启动调用,原consumer与五种关系判断保持逐字不变,之后再次读取并比较完整authority。
- Agent addressing 复用同一helper;whole-source、item limit、Agent/peer过滤、quota差值、recent顺序和succession gap仍分别判定,没有把两组语义测试并成同一个oracle。
对主干的风险 / Risks
当前File、SQLite、隔离真实PostgreSQL、NoKV envelope fixture和其JSON-lines子进程,共20个native/legacy案例PASS,零失败/skip;NoKV结果不冒充真实远端服务资格。TypeScript typecheck、4项直接检查、3项目录canary、公开边界和严格CQR通过。原管道等待的完整套件失败保留为历史;单例正常不能反证它。原完整图中的missing/self和peer反例保证修复没有只让happy path变绿。最强回归风险是截断输入或测试后改变authority,原JSON解析、语义和全量相等断言继续防守。原失败堆栈和采样profile留在私有边界,未加入PR。
同作者最近八项提案已经做边界比较:#7459是canonical/frozen-envelope测试语义,#7460是退出后的子进程回收,均不等同这次进入产品前的stdin等待。当前没有新的兼容层或公共词汇,也没有证据支持贡献限制。未查询、轮询或等待PR CI。此宿主没有原生Windows执行;标准descriptor接口的可移植性不等于已观察到该平台结果。完整发布还需整合#7459后重新资格。
我的整体评价 / Verdict
APPROVE,goal_achieved,仅指这个有堆栈证据的测试传输切片。long_horizon preserved:实际政策、图规模与语义不变,没有模型或成本收益主张;user_experience preserved:界面和入口未改。bounded refactor applied:共享两个真实调用方的资源管理,保留各自独立断言。视觉检查not_applicable,未验证视觉范围none:该diff没有页面、文案或样式变化。作者自审采用COMMENTED结论记录;合并仍需当前head的readiness及维护者授权,不能由本正文代替。
English verdict: APPROVE — 24d6e657339055610792a749c9ec7a9c90494001. A finite stdin source restores all20 original native/legacy consumer cases without changing complete graph input,semantic/no-write assertions or the90-second deadline. Typecheck,premerge,boundary and CQR pass; native Windows and whole-release qualification remain separate.
The full concurrent TypeScript conformance suite intermittently strands a Python read consumer in
json.load(sys.stdin)until the unchanged 90-second timeout. Captured stacks show that no projection or authority operation has started. Single-case and four-consumer baselines complete normally, so raising the deadline or changing database semantics would not address the observed boundary.Feed the same complete JSON through a temporary regular-file stdin descriptor in the two existing read conformance families. A shared test-only helper owns file/descriptor cleanup; the actual Python consumer, full graph, native/legacy arms, semantic assertions, authority byte readback and 90-second deadline remain unchanged. No production behavior, provider default, UI or permissions change.
Validation at
24d6e657339055610792a749c9ec7a9c90494001:The bounded refactor consolidates only the two identical active transport callers. Temporary inputs are synthetic, private to each invocation and removed after the child exits. Native Windows is not executed on this macOS host. Independent exact-head review and readiness remain required before the authorized merge.