Repository navigation
Description
Summary
On Linux, a co-located execution workload can exhaust the bb-app service cgroup and starve the bb server itself. The UI then shows an indefinite spinner because neither the server health endpoint nor the host daemon can respond.
The execution plane exhausting its budget should not make the control plane unavailable.
Environment
bb-app 0.36.1-nightly.31483791719.1- Ubuntu 24.04 / systemd / cgroup v2
- 4 vCPU, 8 GiB RAM, 4 GiB swap
bb-apprunning as a user service- Service limits:
MemoryHigh=3.5G,MemoryMax=4G,MemorySwapMax=512M
Workload
One visible parent thread with one child thread was active. That work expanded into:
- the bb server and primary host daemon;
- a Codex app-server and Pi bridge;
- two concurrent TypeScript checks;
- a persistent browser automation daemon with 16 Chromium renderers.
The browser daemon had reparented to the user systemd manager, but remained in bb.service's cgroup. Its subtree alone used approximately 1.83 GiB RSS.
Observed behavior
The shared cgroup reached approximately 3.8 GiB and stayed above MemoryHigh:
memory.current: ~3.8 GiB
memory.high: 3.5 GiB
memory.max: 4.0 GiB
memory.swap.current: 512 MiB
memory.events high: 2,677,099
memory.pressure some avg10=100.00
memory.pressure full avg10=98.70
The server, browser renderers, TypeScript processes, and a thread waiter entered uninterruptible sleep in:
mem_cgroup_handle_over_high
Both local endpoints timed out:
curl --max-time 5 http://127.0.0.1:38886/health # timeout
curl --max-time 5 http://127.0.0.1:38887/ # timeout
The journal repeatedly reported server and host-daemon event-loop stalls, including multi-second delays. One thread timeline query took 199 seconds. Provider model requests and automation sweeps then timed out. The app continued to display a spinner without explaining that the execution host was resource-exhausted.
This is not the event-queue poisoning described in #1320; there were no repeated rejected daemon-event batches in this incident.
Why this appears structural
The packaged bb-app launcher starts the server and primary host daemon as managed child processes. Under an ordinary systemd deployment, the server, daemon, provider runtimes, and descendants launched by agent tools therefore share one service cgroup.
Runtime/session cleanup exists, but an agent command can intentionally or accidentally start a persistent or daemonized descendant. Resource exhaustion in that execution workload can consequently throttle the server that would need to report, stop, or recover it.
Removing MemoryHigh would change this from deterministic throttling into host-wide memory pressure or an OOM kill; it would not provide failure containment.
Expected behavior
- Execution-host resource exhaustion must not make the bb control plane unavailable.
- Affected turns should fail or pause with an actionable
execution host resource exhaustedstate rather than spin indefinitely. - Operators should be able to run the server without co-located execution, or isolate the primary execution daemon from the server.
Suggested direction
Any one implementation may differ, but the product needs a containment boundary:
- Support a server-only mode that does not start a primary execution daemon.
- Run the primary host daemon/workloads in a separate service or resource domain from the server.
- Detect sustained host/cgroup pressure and reject or pause new turns before the control plane becomes unresponsive.
- Surface execution-host pressure and loss of daemon health in the UI.
- Consider configurable per-host/per-environment budgets and subprocess accounting, including daemonized descendants where the OS supports it.
The immediate local workaround is to use bb multi-machine support and dispatch work to a separate execution host, but failure containment should still be built into the app.
Activity
amadad commentedon Aug 11, 2026
Additional diagnostic detail: this was not a host-wide OOM.
memory.eventsrecordedoom 0andoom_kill 0, while the host still reported about 2.3 GiB available. The freeze was caused by sustained cgroup-v2MemoryHighreclaim throttling: bb tasks blocked inmem_cgroup_handle_over_high, including the server that needed to report and recover the workload. This distinction is important—the failure mode is a control-plane dead zone under execution-plane pressure, not merely an undersized machine being OOM-killed.amadad commentedon Aug 12, 2026
Additional production evidence from the same Atum deployment, now on bb-app 0.37.0:
bb.servicereached its 4 GiBMemoryMaxand the kernel killed the BB server process inside the cgroup.A restart reduced current use, but that is recovery rather than containment. I support the issue's proposed invariant: execution-plane exhaustion must not make the control plane unavailable. A server-only mode or separate resource domain for the primary execution daemon would address the ownership boundary directly.
SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1334.html
bb-app host-daemon joinworks but is unadvertised, untested and heuristic for primary-host resolution), and since Harden host session liveness after sleep #421 host liveness ignores the heartbeat lease so a throttled daemon stays "connected" and threads stay "active" with no failure state or pressure signal.bb-app serverin help/docs/CLI guide, have the installer optionally emit two systemd units (server with modest limits, daemon with the big MemoryHigh/MemoryMax, sharing the data dir so host-id-based primary-host resolution is deterministic), letbb-app host-daemonauto-enroll against a loopback server without the join dance, forward signals in the bb-server wrapper, and add a boot+enroll test; interim workaround today: bb-server.js in one unit + `bb-app --data-dir D host-daemon join --server…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).SawyerHood commentedon Aug 25, 2026
Duplicate of #2433