Issues…Grrr.

3 issues came up today.

  1. TCP Servers (used in many services) were segfaulting all over the place
  2. The ToDo service was returning a nonsense entry after the last entry in a page
  3. Despite earlier fixes the tcp services are still using too many threads because some libraries use mutexes to ensure synchronous access, causing processing threads to wait for the last one to finish.

My notes and solutions

  • tcp server segfault
    • fixed with try catch I think, it is throwing segabrt somtimes (NO! Didn’t sort the segfault!)
    • If response == “” dont reply, seems to fix segfault, no request then read fails… NO! WRONG!
    • Was destroying self before processing thread was done if connection was closed, on close wait for thread then clean up – Works! 🙂
    • Used my own threadsafe_int class to track open threads
  • To Do nonsense
    • Was returning h followed by some random square
    • Crude fix: If response < 7 consider invalid, ignore and move to next page
  • tcpservice::boost::thread_resource_error
    • Track running/waiting threads
    • If > n (about 250) wait before creating a new one
    • Will deal with the later
    • Forking?

The last issue is mainly caused by the powercache not being multi-threaded and the paged queue hanging during processing. I need to improve the powercache and the paged queue needs to open a new temp-page and process the current temp-page on a separate thread.

Leave a Reply