Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix(apple-runner): fence prep spawns after teardown or last-waiter cancellation

Closed
#3,220 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@thymikee is already working on this.

Since Oct 5, 2026.

  • #3239 by @thymikee — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript

Research direction

Start by reading PR #3193 and trace the runner start, preparation-spawn, teardown, and waiter-cancellation paths it changed; the issue does not name source files or tests. Then identify where the session lock is held during close and how retries are admitted. Done means the specified cancellation controls and live close-during-build route show no respawn, close completes, owned children are cleaned up, and the focused tests and affected gate pass.

Written by the indexing model from the issue text.

Description

needs-triage

Purpose

A runner start must stop creating preparation processes after its execution host is torn down or its last interested waiter cancels. Stopping the currently registered children once is insufficient.

PR #3193 measured this during close with a cold build: close killed the first build-for-testing before obtaining the runner session lock, but the detached prewarm health retry spawned a second build while close waited for that lock. Close reached its timeout; the second build remained until daemon stop. Original evidence: https://github.com/callstack/agent-device/pull/3193#issuecomment-5981188182. This observation is at b6cdd3c49, not a fresh reproduction on main.

Required behavior

  • The in-flight runner start owns whether further preparation is admitted. Device teardown closes that admission before stopping current prep children or waiting for the session lock.
  • Canceling the final interested waiter closes admission for that start. Canceling one waiter must preserve work still needed by another.
  • Check admission at every preparation spawn, including retries after a killed build. A check only when registering an already spawned child is too late.
  • A later independent open may create a fresh start; a retired start cannot resume and publish a runner into it.
  • Prefer one start-owned cancellation/admission mechanism. Reassess whether the request-owner prep filter introduced by #3193 remains necessary once the reachable callers and waiter semantics are covered.

Done when

  • A control holds the runner session lock during a cold build, begins non-retained close, and attempts a retry after the first child is stopped. No second prep child is spawned; close settles without waiting for a replacement build.
  • Controls cover cancellation before the first prep spawn, last-waiter cancellation, and another still-interested waiter.
  • Repeat the live close-during-build route with evidence of no respawn, completed close, and cleanup. Retain the original evidence attribution.
  • Focused tests and the affected gate pass; process signaling remains scoped to owned children.

Depends on #3193. This is start admission, not another host-wide timeout sweep or a shorter join timeout.

Dominant language
TypeScript
Stars
4.9k
Forks
328
Avg merge
12h 19m
Merged PRs (30d)
549

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from callstack/agent-device

All issues in callstack/agent-device

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.