One line of code in 4 hours

One line of code in 4 hours

One of my biggest achievements is fixing a bug that took me and a colleague 4 hours together to figure out.

This issue was "resolved" 4-5 times before it got to me. Another colleague, the story owner, thought that this issue is simple, but it wasn't.

The problem did not occur locally or even with the test machine.

How did this issue get my attention? 

I was monitoring production logs on the main microservice. 

There were many errors on the same subject and I found that it's from this "solved" issue.

I raised this issue and I started to work on it. After 1-2 hours, I got stuck, so I asked for help.

A colleague joined me, and after 2-3 hours of working together, we finally got it.

The backend was issuing these problems, so we started to test every line of code to understand where it fell.

We were searching in the wrong place.

After hours of finding nothing on the backend code, we decided to move to the client code.

We started to test again, of course, every line of code.

The client application was sending data pairs of 2 objects each.

Where was the problem? 

Due to a previous bug, one of the objects in the pairs synchronized and the other did not.

So the pairs got desynchronized. 

The data wasn't relevant anymore, and the server didn't accept it, therefore the errors.

How was this problem solved?

We changed the line of code that prepared the data to be sent. Instead of pairing data by an index, we paired them with an id.

It wasn't a problem to send incomplete pairs. The problem was that the application was sending the wrong pairs.

Issue solved in 4 hours with one line of code. I have to admit, it was a very subtle bug.

Conclusion

Sometimes you need to understand the whole flow of the application in order to solve a problem or create a nice feature.

You can't measure the performance or productivity of a programmer in written lines of code.

要查看或添加评论,请登录

Ionut Preda的更多文章

社区洞察

其他会员也浏览了