facebook/flow · critical

Daemon child: failed to set TCP_NODELAY on parent in-socket:

Error message

Daemon child: failed to set TCP_NODELAY on parent in-socket: {}

What it means

Mirror of the out-socket step: after connecting to the parent's in-socket, the daemon child enables TCP_NODELAY on it before writing the token. Failure is an OS-level setsockopt error, realistically only seen when the just-connected socket is already invalid (parent closed it) or the platform rejects the option.

Source

Thrown at rust_port/crates/flow_daemon/src/daemon.rs:560

        panic!(
            "Daemon child: failed to set TCP_NODELAY on parent out-socket: {}",
            e
        )
    });
    child_in_sock.write_all(&token).unwrap_or_else(|e| {
        panic!(
            "Daemon child: failed to write token to parent out-socket: {}",
            e
        )
    });
    let mut child_out_sock = TcpStream::connect(parent_in_addr).unwrap_or_else(|e| {
        panic!(
            "Daemon child: failed to connect to parent in-socket (child write end): {}",
            e
        )
    });
    child_out_sock.set_nodelay(true).unwrap_or_else(|e| {
        panic!(
            "Daemon child: failed to set TCP_NODELAY on parent in-socket: {}",
            e
        )
    });
    child_out_sock.write_all(&token).unwrap_or_else(|e| {
        panic!(
            "Daemon child: failed to write token to parent in-socket: {}",
            e
        )
    });

    exec(&entry_name, child_in_sock, child_out_sock, param_bytes);
}

pub fn close<I, O>(h: &mut Handle<I, O>) -> std::io::Result<()> {
    h.channels.0.stream.shutdown(std::net::Shutdown::Read)?;
    h.channels.1.stream.shutdown(std::net::Shutdown::Write)?;
    Ok(())

View on GitHub (pinned to f88ac94bcf)

Solutions

  1. Retry the command; the race window is tiny
  2. flow stop before retrying to clear half-spawned state
  3. If reproducible in a sandbox, confirm TCP socket option support and escalate to the platform owners
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: Parent closes the in-socket between the child's connect and setsockopt; sandboxed network stacks that do not implement TCP_NODELAY on loopback sockets.

Common situations: Handshake races during daemon spawn on loaded machines; minimal container network implementations; otherwise near-never on standard OSes.

Related errors


AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20). Data as JSON: /api/errors/2a01de325ddf1533. Report an issue: GitHub.