Signals
A unit talks to the platform through a small agent that runs beside it and shares the directory /zaroz. There is no network port: you write files, or call a Unix socket.
What a unit can signal (contract v1, a closed set)
| Signal | Meaning |
|---|---|
ready | I have loaded; send me traffic. Needed only with readiness: signal |
accepting true or false | in or out of the load-balanced set while staying healthy. false removes the unit from traffic and from allocation within about a second |
idle, busy | what the unit is doing. Drives idle_action and the rollout and scale-down choices. Only transitions are recorded |
shutdown | I am done. Same as exiting with code 0 |
Unknown names are ignored and logged by the agent, never fatal.
By file
Code
The agent consumes each file as it appears. An empty accepting file means true.
By socket
HTTP/1.1 over the Unix socket /zaroz/signal.sock:
Code
What a unit receives
| File | Content |
|---|---|
/zaroz/unit.json | key, labels (updated live), origin, workload, private name, public endpoints |
/zaroz/user-data.json | your user_data, or null |
/zaroz/allocation.json | null until allocated, then {id, allocated_at, generation} |
/zaroz/state.json | {draining: false} or {draining: true, reason: "stop" | "destroy" | "replace" | "scale_down"} |
Every file is written atomically (a temporary name, then a rename), so a reader never sees half a file. Read them again when allocation.json or state.json changes; the socket's ?wait= long-polls save the polling.
A minimal unit
Code
Where signals go
The agent writes them to a per-unit object in the cluster; the platform watches it. Nothing billed depends on a signal, so a program that lies about its signals can only stop, idle-destroy or mark full its own unit.
If the region is unreachable, units keep serving and load balancing (readiness is local); allocation answers 503 region-unreachable.
