DEV Community

Ben Halpern
Ben Halpern Subscriber

Posted on

What's your approach to fixing a "long-term" hairy bug?

You come across an issue that just ain't getting fixed in a short amount of time? What goes through your head, what do you begin to think about?

Oldest comments (24)

Collapse
 
paula2001 profile image
Paula George

redo the whole project lol

Collapse
 
charliedevelops profile image
charliedeveloper

not necessarily what exactly needs to happen to fix it, but how can the whole team be involved in fixing it so that it doesn't happen again. With everyone getting involved it:

  • makes everyone realise what level of effort it takes to fix it if they let it happen again.
  • prevents knowledge silos
  • collaborative code on complicated legacy projects usually looks less like spaghetti than if approached individually.
Collapse
 
paula2001 profile image
Paula George

if the bug is hairy as u say i will start with roots and re-build the whole code without rewriting it just double check everything and i hope u were using any kind of version control just print everything

Collapse
 
acoh3n profile image
Arik

I'll start suspecting a race condition or some other concurrency issue. These are usually the hardest to detect and kill.

Collapse
 
sudiukil profile image
Quentin Sonrel

Why fix it when I can make it a feature? 😁

Collapse
 
gokatz profile image
Gokul Kathirvel

The greatest part is the users might get used to it and fixing the bug may create churn πŸ˜πŸ˜†

Collapse
 
stephanie profile image
Stephanie Handsteiner

β€œIt's not a bug, it's a feature (now)!β€œ :D

Collapse
 
ben profile image
Ben Halpern

Given that I have the privilege of just hacking and making it up as I go, this is half my day I swear.

Collapse
 
monknomo profile image
Gunnar Gissel

My thoughts turn to mitigation and isolation.

First things first, how can I make it livable for however long I have to live with it? Can I put a cron in to restart a troublesome service? Can I add more retries to talk to a box with a bad network? Can I wrap a bad library with something that makes it less bad?

Second, how can I contain the problem so when I want to fix it properly I can do it quickly and without hurting the rest of the system? Interfaces, facades, etc.

Finally, I like to document how much the issue hurts the team in terms of lost productivity and hours spent messing with it - never hurts to have ammo to convince stakeholders and supervisors that we should make a persistent problem a priority.

Collapse
 
mjac profile image
Mitch Jackson

How long has this bug existed, and is it generating issues for customers?

Can I present a work-around approach to the team to mitigate the bug's impact?

Can I make a business case to management/client to allocate resources to fix this bug? What are the costs to repair the bug? What are the costs to ignore the bug?

Collapse
 
justinctlam profile image
Justin Lam

Can I add telemetry data or traces? Keep gathering data, which over time will give me enough information to formulate a hypothesis. Hopefully.

Collapse
 
andrekelvin profile image
AndreKelvin

It's a feature leave it like that πŸ˜‚πŸ˜‚

Collapse
 
satansly profile image
Omar Hussain

Usually if a bug is taking long to trace, then its better to sleep over it. Most of the times its just a wrong approach one is taking in tracing it. Also its better to take such bugs at the end, if they aren't show stoppers, to save and spend valuable time on being actually productive.