We had to fix a Heisenbug. ��(a bug that never breaks when you look at it) ��This was a bug that happened only in production, didn't break every time, and never broke while debugging.�� It also got less frequent the more we added logging to report on the current state when the bug happened.�� We knew it was a timing issue but exactly what was happening eluded us.�� The trick eventual was logging.�� We kept adding and removing logging and mapping the state during the bug until we understood it on paper.�� Then we created a test that reproduced it, fixed it, and celebrated!�� It was really difficult!�� The lesson is that no matter how difficult or infrequent the bug occurs with enough persistence and hard work you can figure it out!
All the best,
Ron Teitelbaum