~learn.
0:00 / 1:26
Case file · BridgeLink

The tunnel was up. The phone behind it was dead.

transcript

The tunnel is running. The phone behind it is dead. Your teammate connects from home. To nothing.

I built BridgeLink to reach a team's own Android phones from anywhere. Through tunnels. But phones misbehave. The battery dies mid-test. WiFi drops. Someone unplugs the cable. And the tunnel? Still running. So who notices?

A health monitor. Every second, it pings each active phone. It answers? Fine. It stays active. No answer? Stop that tunnel. Mark the phone inactive. Nobody connects to a dead phone.

But here's the catch. A hung phone doesn't fail. It just never answers. Without a timeout, that check hangs. And every other phone's check waits behind it. So each ping runs off the event loop, with a 5-second timeout. A timeout counts as a failure. A hung device is an unhealthy device.

Watch it work. A developer accidentally unplugs a phone. One second later, the health monitor marks it inactive. They plug it back in. A second daemon is watching for returning phones. One second later, a fresh tunnel. Active again.

About two seconds of downtime. Zero developer action. Give every health check a timeout. A hung device is an unhealthy device.

Full breakdown in the lecture.