Troubleshooting Concurrency Issues
All non-trivial programs have bugs. When you realize that there are some anomalies in a program, starting a debugging session is usually not the first thing you should do. This chapter is about some of the techniques you can use for troubleshooting without using a debugger. You may find, especially when dealing with concurrent programs, that debuggers sometimes do not offer much help and the solution relies on careful code reading, log reading, and understanding stack traces.
In this chapter, we will explore the following:
- How to read stack traces
- How to detect failures using additional code to monitor program behavior and sometimes heal the program
- Debugging anomalies using timeouts and stack traces