TIL on
Bah, heisenbug!
A heisenbug is a software bug that seems to disappear or alter its behavior the moment you try to study it. Sometimes adding a log statement, stepping through a debugger, or making an unrelated code change is enough to make the problem vanish.
The name puns on Werner Heisenberg’s uncertainty principle—the rule in quantum mechanics that certain pairs of physical properties, such as a particle’s position and momentum, cannot both be known precisely at once. It’s also a reference to the observer effect, which states that the act of measuring a system inevitably disturbs it. So it is with a heisenbug—the moment you try to observe it, you change the conditions that produced it, and the bug slips away.