This is what we learned from our bad experience, with an happy ending.
We were swaggering on our perfect code base, oh yeah the asyncronous jobs were working so good, the thread pool was implemented perfectly, everything was so good that we started thinking we deserved a trip to Hawaii, where we would have spent all our money, laughing and joking, drinking with cute hawaian girls and…..BOOM, suddleny our Java Unit tests exploded!
Nooooo!!!!!!! We started looking for the damn fuck*n bug that ruined all our dreams, all our glory..
Seconds, minutes, hours passed, we were tired, hungry, thirsty..Mike was looking old, I started raving, the tea got cold! We were alone, in the dark, at 2am, with that bug. After a bunch of time, Mike saw the promised land above the breakpoint, while I was seeing pretty ladies coming in the room during our debug session. You know, the promised land it’s ok, but when you see nice girls around you while debugging, there’s clearly something that’s going wrong. We took a deep breathe of fresh air - and some beers.
We looked at each other, perplexed, and in a couple of minutes we were back again on the desk.
After some heavy, boring, challeging, debugging sessions, and some beers, we looked carefully at the locks on shared variables between threads and…we finally found it!
I started crying, Mike saw the Holy Grail above the toolbar, we were so damn excited!!
You know, it was like when you pass that unpassable exam at school, like when you win the lottery, like this:
Both of us..
We fixed the bug and, ta-dam! Our asyncronous jobs were working again.
Never drink hot tea during a debug session, cause it gets cold after a while.