facebook/flow · critical
Daemon child: failed to set TCP_NODELAY on parent out-socket
Error message
Daemon child: failed to set TCP_NODELAY on parent out-socket: {} What it means
Immediately after connecting to the parent's out-socket, the daemon child enables TCP_NODELAY for low-latency writes. set_nodelay failing at this point is an OS-level setsockopt error, which in practice only happens when the socket is already invalid/errored (parent closed it) or the platform refuses the option in the current network context.
Source
Thrown at rust_port/crates/flow_daemon/src/daemon.rs:542
let Some((entry_name, context)) = entry::get_context() else {
return;
};
entry::clear_context();
let entry::Context {
parent_in_addr,
parent_out_addr,
token,
param_bytes,
} = context;
let mut child_in_sock = TcpStream::connect(parent_out_addr).unwrap_or_else(|e| {
panic!(
"Daemon child: failed to connect to parent out-socket (child read end): {}",
e
)
});
child_in_sock.set_nodelay(true).unwrap_or_else(|e| {
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!(View on GitHub (pinned to f88ac94bcf)
Solutions
- Retry the command (the race window is tiny and rarely repeats)
- Run flow stop first to reset any half-spawned daemon state
- If persistent in a sandbox, verify TCP socket options are supported and report to the sandbox/network layer owners
Defensive patterns
Strategy: retry
Prevention
- Treat one-off handshake failures as transient; retry before debugging
- In sandboxed runtimes, confirm TCP socket options like TCP_NODELAY are supported
- Avoid killing the parent during daemon spawn windows
When it happens
Trigger: The parent closes the accepted socket in the microsecond window between the child's connect and setsockopt; exotic network stacks/sandboxes rejecting TCP_NODELAY on loopback sockets.
Common situations: Racing parent exit during daemon spawn; minimal kernel/sandbox network implementations; extremely rare on stock Linux/macOS/Windows.
Related errors
- Daemon child: failed to set TCP_NODELAY on parent in-socket:
- Daemon child: failed to connect to parent out-socket (child
- Daemon child: failed to write token to parent out-socket: {}
- Daemon child: failed to connect to parent in-socket (child w
- Daemon child: failed to write token to parent in-socket: {}
AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20).
Data as JSON: /api/errors/9f095bdcbc83368e.
Report an issue: GitHub.