Files
start-os/core
Aiden McClelland 2bb1463f4f fix: mitigate tokio I/O driver starvation (tokio-rs/tokio#4730)
Tokio's multi-thread scheduler has an unfixed vulnerability where all
worker threads can end up parked on condvars with no worker driving the
I/O reactor.  Condvar-parked workers have no timeout and sleep
indefinitely, so once in this state the runtime never recovers.

This was observed on a box migrating from 0.3.5.1: after heavy task
churn (package reinstalls, container operations, logging) all 16 workers
ended up on futex_wait with no thread on epoll_wait.  The web server
listened on both HTTP and HTTPS but never replied.  The box was stuck
for 7+ hours with 0% CPU.

Two mitigations:

1. Watchdog OS thread (startd.rs): a plain std::thread that every 30s
   injects a no-op task via Handle::spawn.  This forces a condvar-parked
   worker to wake, cycle through park, and grab the driver TryLock —
   breaking the stall regardless of what triggered it.

2. block_in_place in the logger (logger.rs): the TeeWriter holds a
   std::sync::Mutex across blocking file + stderr writes on worker
   threads.  Wrapping in block_in_place tells tokio to hand off driver
   duties before the worker blocks, reducing the window for starvation.
   Guarded by runtime_flavor() to avoid panicking on current-thread
   runtimes used by the CLI.
2026-03-25 10:14:03 -06:00
..
2025-12-22 13:39:38 -07:00
2025-12-31 11:30:57 -07:00
2026-03-20 08:50:54 -06:00
2025-11-07 10:12:05 +00:00
2025-12-22 13:39:38 -07:00

StartOS Backend

Structure

  • startos: This contains the core library for StartOS that supports building startbox.
  • helpers: This contains utility functions used across both startos and js-engine
  • models: This contains types that are shared across startos, js-engine, and helpers

Artifacts

The StartOS backend is packed into a single binary startbox that is symlinked under several different names for different behavior:

  • startd: This is the main daemon of StartOS
  • start-cli: This is a CLI tool that will allow you to issue commands to startd and control it similarly to the UI
  • start-sdk: This is a CLI tool that aids in building and packaging services you wish to deploy to StartOS

Documentation