I received an email this morning from my manager saying that I need to look at this one utility, because it's showing a high CPU utilization and preventing another application from running. The utility runs on a Terminal Server so the problem is exaserbated by multiple users in different sessions.
Keep in mind that this utility has been in production for several months and there have been zero bug reports. But, sure enough using the information I was able to duplicate the problem and based on the details of the problem I knew what function was causing the problem and I quickly saw the problem:
// wait for a signal from AddRequest, ClearError, or the Stop method
if (_disposed)
_waitHandle.WaitOne(timeout, false);
A half a day of work lost, because I messed up the logic and should have said, "if (!_disposed)". Oh well, it seems that no matter how well you think you test the code that there's always the possibility of something funny like this that you don't look for. I feel comfortable saying that the utilty is still well tested since its not a trivial utility and I've only had one bug report. But, I still feel like slapping myself for that funny little logic error.
Anyone else do these funny little logic errors?