[Libreoffice-commits] online.git: kit/ForKit.cpp wsd/Admin.cpp wsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Thu Feb 9 04:37:38 UTC 2017


 kit/ForKit.cpp  |    4 +++-
 wsd/Admin.cpp   |    2 +-
 wsd/LOOLWSD.cpp |    9 ++++++---
 3 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 3fb136170f1ac8b27f5aa2e0a1f4bf0c4d5a939f
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Feb 8 23:19:29 2017 -0500

    wsd: extend timeout when nocaps is specified
    
    Change-Id: Id10b38716cc184bf899120bbe18d9095fd2f48e5
    Reviewed-on: https://gerrit.libreoffice.org/34053
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 6362940..fa2bebe 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -439,8 +439,10 @@ int main(int argc, char** argv)
     if (!std::getenv("LD_BIND_NOW"))
         LOG_INF("Note: LD_BIND_NOW is not set.");
 
-    if (!haveCorrectCapabilities())
+    if (!NoCapsForKit && !haveCorrectCapabilities())
+    {
         return Application::EXIT_SOFTWARE;
+    }
 
     // Initialize LoKit
     if (!globalPreinit(loTemplate))
diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 68b511f..b1e8c11 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -354,7 +354,7 @@ void Admin::rescheduleMemTimer(unsigned interval)
     _memStatsTask->cancel();
     _memStatsTaskInterval = interval;
     _memStatsTask = new MemoryStatsTask(this);
-    _memStatsTimer.schedule(_memStatsTask.get(), _memStatsTaskInterval, _memStatsTaskInterval);
+    _memStatsTimer.schedule(_memStatsTask, _memStatsTaskInterval, _memStatsTaskInterval);
     LOG_INF("Memory stats interval changed - New interval: " << interval);
 }
 
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 3f719cb..6a3784a 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -421,7 +421,8 @@ static void preForkChildren(std::unique_lock<std::mutex>& lock)
     UnitWSD::get().preSpawnCount(numPreSpawn);
 
     // Wait until we have at least one child.
-    const auto timeoutMs = CHILD_TIMEOUT_MS * 3;
+    // With valgrind we need extended time to spawn kits.
+    const auto timeoutMs = CHILD_TIMEOUT_MS * (LOOLWSD::NoCapsForKit ? 150 : 3);
     const auto timeout = std::chrono::milliseconds(timeoutMs);
     LOG_TRC("Waiting for a new child for a max of " << timeoutMs << " ms.");
     NewChildrenCV.wait_for(lock, timeout, []() { return !NewChildren.empty(); });
@@ -500,8 +501,10 @@ static std::shared_ptr<ChildProcess> getNewChild()
             return nullptr;
         }
 
-        LOG_TRC("Waiting for a new child for a max of " << CHILD_TIMEOUT_MS << " ms.");
-        const auto timeout = chrono::milliseconds(CHILD_TIMEOUT_MS);
+        // With valgrind we need extended time to spawn kits.
+        const auto timeoutMs = CHILD_TIMEOUT_MS * (LOOLWSD::NoCapsForKit ? 100 : 1);
+        LOG_TRC("Waiting for a new child for a max of " << timeoutMs << " ms.");
+        const auto timeout = chrono::milliseconds(timeoutMs);
         if (NewChildrenCV.wait_for(lock, timeout, []() { return !NewChildren.empty(); }))
         {
             auto child = NewChildren.back();


More information about the Libreoffice-commits mailing list