Background threads are unable to reliably wakeup blocked clients.
A short description of the bug.
The module machinery to unblock clients was re-written in 7.0. The scheme uses a pipe to notify the mainthread that an unblock has been requested. However, when the function modulePipeReadable is invoked by the mainthread it fails to call moduleHandleBlockedClients to check the list of unblock requests. This appears to work because the beginSleep function does call that function. However, this is unreliable and can result in missed wakeups.
To repro the problem, you need a command that processes requests in the background, blocking and unblocking the associated client. Then if you flood the mainthread with those requests you will see that it occasionally goes idle because all of the applications requests remain blocked (their unblock is in the list, but the list didn't get processed).
A description of what you expected to happen.
I expect modulePipeReadable to call moduleHandleBlockedClients.
Comment From: madolson
This initially made sense to me, but I'm not sure I understand how beginSleep is unreliable. beginSleep() is always called at least once after the modulePipeReadable before the main thread goes to sleep waiting for additional events.
Comment From: madolson
Let's just have the discussion on the PR.