wsd: improved forkit logs
And avoid pid of 0 in getKitPids(). Change-Id: I68743a55aed080ed54d7d8576f269974c644e1b2 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
parent
5312e78aaa
commit
4322f87d92
2 changed files with 17 additions and 1 deletions
|
@ -278,6 +278,9 @@ static void cleanupChildren()
|
|||
int status = 0;
|
||||
int segFaultCount = 0;
|
||||
|
||||
LOG_TRC("cleanupChildren with " << childJails.size()
|
||||
<< (childJails.size() == 1 ? " child" : " children"));
|
||||
|
||||
// Reap quickly without doing slow cleanup so WSD can spawn more rapidly.
|
||||
while ((exitedChildPid = waitpid(-1, &status, WUNTRACED | WNOHANG)) > 0)
|
||||
{
|
||||
|
@ -304,6 +307,16 @@ static void cleanupChildren()
|
|||
}
|
||||
}
|
||||
|
||||
if (Log::traceEnabled())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
for (const auto& pair : childJails)
|
||||
oss << pair.first << ' ';
|
||||
|
||||
LOG_TRC("cleanupChildren reaped " << cleanupJailPaths.size() << " children to have "
|
||||
<< childJails.size() << " left: " << oss.str());
|
||||
}
|
||||
|
||||
if (segFaultCount)
|
||||
{
|
||||
#ifdef KIT_IN_PROCESS
|
||||
|
@ -414,6 +427,8 @@ void forkLibreOfficeKit(const std::string& childRoot,
|
|||
const std::string& loSubPath,
|
||||
int limit)
|
||||
{
|
||||
LOG_TRC("forkLibreOfficeKit limit: " << limit);
|
||||
|
||||
// Cleanup first, to reduce disk load.
|
||||
cleanupChildren();
|
||||
|
||||
|
|
|
@ -4923,7 +4923,8 @@ std::set<pid_t> COOLWSD::getKitPids()
|
|||
for (const auto &child : NewChildren)
|
||||
{
|
||||
pid = child->getPid();
|
||||
pids.emplace(pid);
|
||||
if (pid > 0)
|
||||
pids.emplace(pid);
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue