PP now uses PriorityThreadPool that arbitrary picks another jobs pack
to run. This scheduling discipline tend to run portions of a single query
forcing other simultaneous queries to wait. In result parallel queries
timings variance is high. The FairThreadPool picks the job with the smallest
amount of work done so far(see the code for details)
respondWait could be set to false
while other threads were waiting. With respondWait false, okToRrespond
wouldn't ever get notify_one(). Get rid of respondWait and use
fProcessorPool->blockedThreadCount to determine if any threads may be
waiting.
PriorityThreadPool didn't have very good error handling. If something
failed it would just ignore whatever was being processed. This could
lead to a query continuing without retreiving all of the required data.
This patch adds error handling, sending a message back to the client
and a log message. It also destroys and recreates the pool thread.