Baby

Bushbaby Automated Bamboo Yields

Sync for Bamboo stores using the Bushbaby protocol

Connection tuning

The per-connection idle timeout is governed by four settings, all read from Application config (config :baby, ...) at connection startup, and overridable per-connection:

The idle counter resets on any send or receive, so the budgets measure consecutive silence rather than wall-clock time on a busy link. A connection that exceeds its budget is dropped and re-established on the next cryout.

To estimate wall-clock time, multiply the budget by :outrate — e.g. a default max_spins of ~1193 at a default outrate of ~80ms is roughly 95 seconds, and a default bootstrap_spins of ~2969 is roughly 4 minutes.

config :baby,
outrate: 100,
handshake_spins: 375,
max_spins: 1200,
bootstrap_spins: 5000

Wire buffer

Inbound bytes that have not yet formed a complete protocol frame are buffered in the connection's wire state. A peer that dribbles undecodable bytes could otherwise grow this buffer without bound, so it is capped:

The cap sits comfortably above the largest legitimate frame (a single message may carry an entire log), so it should only trip for garbage; note the protocol spec guidance on authoring log entries that fit within peers' limits.

Listener

The ranch listener that accepts peer connections has a deliberate ceiling on concurrent connections, so a flood of anonymous connections cannot exhaust file descriptors or slot-bound the legitimate peer:

config :baby, max_connections: 256