S16E04: bug-hunting

This week has been absolutely bananas. I spent two days chasing down a bug. Stability is a lie and all change carries risk but, nonetheless, I really could have done without it.

Firstly, this feels like a personal attack:

I remember when all this was Nirvana.

This week’s been a weird one, honestly. I had high hopes at the beginning of the week that the refactoring I’d done would be reviewed. I’ve been working to disentangle my new codebase. It’s in a slightly precarious state at the moment: it works, and it works well, but fitting it into your head requires a couple of hours of digesting. In the jargon we call this ‘reasonability’. How easy is the code to reason with? Does everything flow logically, or do we have loops and arcs and bag-ends1? Right now, the best approximation I have is that it’s like the big ball of necklaces that my partner hands me every so often. I enjoy it, because I am a strange and feral goblin whose mind just works like that. I can spend hours just teasing things apart.

Hey, guess what makes me an excellent bug-hunter?

Hey, guess what I’ve been doing for the past two days instead of having my cool refactor reviewed?

I have chased a subtle bug up and down our stack, through our network, through multiple systems handing snippets of data off to each other to finally uncover the change that resulted in the bug. A glorious edge case. Evidence that every change breaks someone’s workflow.

A reminder that writing good commit messages is a love letter to your future self, or sometimes a bizarre scrawl that you regret writing.

The thing is, when you do finally find the bug, it’s such a fierce rush. It was about 1815 in the evening and I was trying one more thing. It’s always the last thing you try, isn’t it?2 The last thing I tried turned up the beginnings of something. I feel something stir. There is a pattern here. A sequence of steps that seem to reveal the bug. I’m looking at the logs – the things we’ve programmed the system to tell us. There are some things it only tells us when it follows very specific paths through its logic. Here, in front of me, was the sequence of messages that indicated a wrong turn.

A sequence, I should say. The logs might be wrong; or the destination reached via some other path. So I check it. I get the code in front of me and confirm that there is only one set of steps that result in this output. I do a kind of…differential diagnosis. The buzzing joy that I’ve found the answer has to be boxed away in case it infects my thinking, and instead I ruthlessly examine every possibility that would make me wrong.

There are no other possibilities. This is it. This is the one.

All of the adrenaline that’s been keeping me upright seems to leave at once and I just go completely floppy in my chair. I can’t even type. I feel shaky and slightly queasy. I gibber out a voice note to my colleague who sends back a single word: HERO.

I’m good at this. I’m really good at this.

It’s consumed me for two working days straight. Has it been a good use of my time? Has it been a good use of my energy? How do I feel after finding it? Elated, yes, but exhausted. I’m almost hungover as I write these. Is this…is this good for me?

Hard to say. I went on a date on Monday, and came back from that exhausted and elated – but the next day wasn’t like this. It’s something to keep an eye on, both personally but also as a system-wide question: how do we ensure there are as few of these kinds of days as possible?

There’s no obvious answer, nor am I seeking one. Just something to think about.

  1. French: cul-de-sac ↩︎
  2. Yes, obviously. Who’s continuing to try after they’ve succeeded? ↩︎

Leave a comment