Worker aborts with V8 OOM in JSON.parse when several exec requests carry large stdin payloads; all leases lost
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
Start at the worker and gateway handling for POST /v1/leases/:id/exec, then trace where the request body is materialized and parsed. The issue does not name files or tests, so locate the relevant entry points and existing request-size or concurrency limits first. Done means oversized or concurrent large stdin requests are rejected with a typed error instead of crashing the worker; streaming or preserving leases across restarts are broader alternatives.
由索引模型根据 Issue 内容生成。
描述
Summary
A simlock 0.5.0 worker (Node 22.23.4, macOS, gateway mode) aborts with a V8 out-of-memory error while parsing an incoming message with JSON.parse. This happens when several POST /v1/leases/<id>/exec requests carrying a large stdin (base64 payloads of tens of MB) are in flight at once. Every lease on that worker is lost: in-flight execs return 503 after about 105 s, and later calls get 404 UNKNOWN_LEASE.
Evidence
Crash report node-2026-11-03-144256.ips:
EXC_CRASH (SIGABRT) — abort() called
node::OOMErrorHandler
v8::internal::V8::FatalProcessOutOfMemory
v8::internal::Heap::CollectGarbage
v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath
v8::internal::FactoryBase::NewRawStringWithMap<SeqOneByteString>
v8::internal::JsonParser<unsigned char>::MakeString
v8::internal::JsonParser<unsigned char>::Parse
v8::internal::Builtin_JsonParse
- Worker log: the next start at 13:42:56Z logs
Recovered stale daemon socket/Daemon startedand re-establishes the gateway uplink.launchctlreports the last exit as-6. - Gateway log for one lease:
device.exec→POST …/exec 503after 105,242 ms → the client releases →POST …/exec 404 UNKNOWN_LEASE. - Workload: a tester-army
e2esuite with 10 workers. Each worker uploads an ~89 MB fixture archive (deflated, base64 instdin) throughexec(simctl spawn <helper> untar) at the same moment. The host's load average was about 70. - The same burst also produced Cloudflare
524s and connection resets on other runs, because each exec holds a single long request.
Root cause
The worker (or its gateway uplink) materialises each exec request, stdin included, as one JSON string and parses it on the heap. Concurrent large stdin payloads exceed the V8 heap limit, and the process aborts instead of rejecting the request.
Suggested fix
- Bound the accepted
execstdinsize per request, and the total in flight per worker. Reject an over-limit request with a typed error (413/PAYLOAD_TOO_LARGE) instead of crashing. - Stream
stdinthrough the uplink and into the child process instead of parsing it as a single JSON string, or offer a separate upload endpoint, so large file transfers don't sit on the JSON path. - Optionally, keep lease state across a worker restart (the leases were lost even though the devices survived).
On the client side, we are capping concurrent large uploads (consumer issue linked below), but a worker should not be crashable by request size.
- 主要语言
- TypeScript
- 星标
- 535
- 派生
- 21
- 平均合并
- 9 小时 53 分钟
- 30 天内合并 PR
- 435
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstackincubator/simlock 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
callstackincubator/simlock#1248 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 78/100
callstackincubator/simlock#1234 · 1 条评论 ·
维护者通常 1 天内回复
-
bug:new
难度 2/5 1-3 小时 新手友好度 76/100
callstackincubator/simlock#1229 · 2 条评论 ·
维护者通常 1 天内回复
-
os:windows request:new
难度 2/5 1-3 小时 新手友好度 70/100
callstackincubator/simlock#1071 ·
维护者通常 1 天内回复
-
task:draft
难度 5/5 一周以上 新手友好度 15/100
callstackincubator/simlock#1261 ·
维护者通常 1 天内回复
查看 callstackincubator/simlock 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
reproduced
难度 2/5 1-3 小时 新手友好度 74/100
anomalyco/opencode#62052 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
strapi/design-system#2084 ·
维护者通常 3 天内回复
-
check:passed streams:remove
难度 1/5 1 小时以内 新手友好度 67/100
维护者通常 1 天内回复
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scope未关闭
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复