Repository navigation
fix(ports): run() always ends its child at a deadline, and Android boot probes get what is left of the boot deadline - #1584
Conversation
…ot probes get what is left of the boot deadline run() armed its kill timer only when the caller passed timeoutMs, so a call without one waited for its child for ever. It now applies a 60 s default on the same SIGTERM-then-SIGKILL path. The three Android readiness probes get the time left of android.bootTimeoutMs, so a hung adb ends the boot with BootTimeoutError instead of holding the lease request and its reserved slot. avdmanager create avd names its own deadline. A dependency-cruiser rule keeps child_process imports in src/ports/ to the runner and the long-lived launchers.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for this. The bug is real: on Android, an Better solutionWhat the PR solves: The boot probe half is the right fix. The 60 s default in
Why this is better: a future caller that forgets a deadline gets a compile error, not a child that is killed silently after 60 s with Side effects
ReviewThe blind pre-merge review ( The review checked the PR on its own base. The conflict with Written by an agent. |
… default main split process-runner.ts into node-process-runner.ts, process-runner-types.ts and process-tree-kill.ts, and moved the boot-deadline test to index-boot.test.ts; the PR's changes are carried to those files. As proposed in the review: ProcessRunner.run takes BoundedRunOptions, whose timeoutMs is required (architecture rule 11 asks for an explicit deadline), so the compiler finds a call without one. The default and its constructor option are gone. The Android calls that had none now name their own bound: adb devices in the port allocator uses ADB_DEVICES_TIMEOUT_MS (30 s), the mark write 5 s, emulator -version 30 s, avdmanager create and delete AVDMANAGER_TIMEOUT_MS (60 s). The child-process-owners lint rule is dropped: the type now holds the rule. #bootProbe is kept as it was.
… deadline without importing adb-tools
Problem
ProcessRunner.run()armed its kill timer only when the caller passedtimeoutMs, and several Android calls passed none. The worst is the readiness wait: its three probes had no deadline, so anadbthat hangs on one holds the lease request and its running slot until the daemon restarts.Change
runrequires a deadline.ProcessRunner.runtakesBoundedRunOptions, whosetimeoutMsis required (architecture rule 11). There is no default.spawnis unchanged.adb devicesin the port allocator 30 s (ADB_DEVICES_TIMEOUT_MS), the mark write 5 s,emulator -version30 s,avdmanager createanddelete60 s (AVDMANAGER_TIMEOUT_MS).#bootProbegives each probe what is left ofandroid.bootTimeoutMsand throwsBootTimeoutErrorwhen it runs out.Tests
process-runner.test.ts:runends a child at itstimeoutMs, and at once for0andInfinity.index-boot.test.ts: three rows, one per probe that never exits, each failing withBootTimeoutErroratandroid.bootTimeoutMs.Assumptions
adb devicesbound — the 30 slistManagedalready gives the same command.Review
Spec review: skipped. Code review: 0 blocking, 0 fixed, 1 notes. Claims review: skipped.
Rounds: 2. Tokens: 1.5M.
Runs: 2. Cost USD: 0.5363. Agent seconds: 139.
android.bootTimeoutMshas no upper bound (src/drivers/android/definition.ts:54), so a value above 2^31 ms would fire the probe timer at once; unrealistic, not blocking.Assessment: complete
Written by an agent.