mirror of
https://github.com/hanzoai/kafka.git
synced 2026-10-30 14:48:25 +00:00
The broker named three APIs as the chatty ones and announced every other frame at Info. That is a guess about which calls a client repeats, and it was wrong about the one that matters. Measured in production: Metadata was 824 of 1200 log lines, 69% of everything the process said. Eight minutes of that rotates a pod's boot errors out of reach, which is how the last outage came to need forensics instead of a read. Every received frame is Debug now, so there is no list to keep correct as APIs are added. Info stays for what an operator did not already know. Two races were in the way of proving it, and `go test -race ./...` had never passed here — seven at HEAD, before any of this. Serve published the listener while Addr and Shutdown read it, with nothing ordering the three. The bound port is now settled before the listener is published, so a caller that can see one can see the other. The level itself was a plain global read by every logging goroutine, and the sink was chosen by a log.SetOutput on every single line — a process-global written concurrently from every connection, which also left no way to read back what was written. The level is atomic and the sink is chosen once. TRACE was missing from the severity map and scored zero by absence; saying it is cheaper than rediscovering why the order comes out right. Co-authored-by: Hanzo Dev <[email protected]>