by wvh · 2w ago · 0 comments
An important part is that clients pre-fail most requests and don't send them if the server is overloaded. They just assume the server would return an overload error and fake it on the client. For Google, this is an effective circuit breaker.
Which reminds me, someone, maybe Netflix or Google, already discussed circuit breakers much earlier than that. You have to cut off the misbehaving part of the system so the failure doesn't propagate.
It's also something in Golang philosophy. Every channel (queue) has a maximum capacity and you can wait to send on a channel, just like you wait to receive from one. A trivial use case I've written is to coalesce status updates - if the status changes again while the network writer thread still hasn't accepted the old one yet, then a buffer thread just silently drops the older update and keeps trying to send the newer one, and this is trivial in Go.