wsd: avoid deadlock when restoring forkit

LOOLWSD::checkAndRestoreForKit() eventually takes
NewChildrenLock, which is also taken in getNewChild_Blocks().

Luckily, we can defer that to the Prisoner poll, which we do.

Change-Id: Ib65c0be08870d1c4c68efd72192dac2e73c79f7c
Reviewed-on: https://gerrit.libreoffice.org/38992
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian 2017-06-19 22:15:59 -04:00 committed by Ashod Nakashian
parent 7ae37aff0d
commit c28992758d

View file

@ -401,9 +401,9 @@ std::shared_ptr<ChildProcess> getNewChild_Blocks()
++numPreSpawn; // Replace the one we'll dispatch just now.
if (rebalanceChildren(numPreSpawn) < 0)
{
LOG_DBG("getNewChild: rebalancing of children failed. Checking and restoring forkit.");
LOG_DBG("getNewChild: rebalancing of children failed. Scheduling housekeeping to recover.");
LOOLWSD::checkAndRestoreForKit();
LOOLWSD::doHousekeeping();
// Let the caller retry after a while.
return nullptr;