Debugging with a Camera
Most of my photos are of the sky. I shoot on my phone, mostly on auto, with a few shots in Pro mode. Somewhere along the way I noticed that photography and debugging ask for the same skill: knowing what’s worth waiting for, and what isn’t.
The stars took patience, just not the kind you’d expect. They were already up there. I had to wait for the phone. Night mode takes its time: you press the shutter, hold as still as you can, and let it gather light until every faint star comes through.
That’s a wait worth doing. You know what’s happening, you know roughly how long it takes, and at the end you get the stars. The camera is busy the whole time, and the result is worth every second of holding still.
Then there was the bug where our LLM requests were accepted and never answered. Every request went in. Nothing failed. Nothing came back either.
With the stars, waiting is the method. With a request that’s been accepted and gone quiet, waiting is the bug. What I took from it:
Accepted isn’t answered. A request being received tells you nothing about whether a response is coming. Measure the whole round trip, not just the hand-off.
Everything needs a deadline. If you don’t decide how long to wait, something else decides for you, and sometimes that something is “forever”.
Silence is a symptom. Errors are easy, because they shout. The hard failures are the ones that look exactly like “still working”.
Most of my photos are on auto, and that’s fine. The defaults are good for the average scene. A few shots needed Pro mode, because the scene in front of me wasn’t the average one.
Software defaults work the same way, and timeouts are the classic trap. Plenty of HTTP
clients won’t give up on a request unless you tell them to. Python’s popular
requests library, for one, has no timeout unless you set it. The default is
fine right up until the moment the other side goes quiet.
The first was taken a little after seven in the morning. The second, at dusk on another street. Same city, completely different light.
Systems change with the hour too: traffic peaks, scheduled jobs, cold starts after a quiet night. “It worked when I tried it at 10 a.m.” is a photo of one moment, not proof about the whole day.
The rainbow was just there. I was lucky enough to spot it. No waiting, no settings, no plan.
Some bugs are like that. You catch them because you happened to glance at the right graph at the right moment. You can’t plan for luck, but you can make sure you’re looking up often enough to notice it.
Know what you’re waiting for. The stars, yes. A response from a request that went quiet a long time ago, no. And keep the camera handy, because sometimes the rainbow is just there.