[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/DocumentBroker.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Jul 31 11:13:14 UTC 2017


 wsd/DocumentBroker.cpp |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 46b53d7df12591362c6e76e037b8b136a465bc28
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Jun 21 21:49:08 2017 -0400

    wsd: don't busy wait when getNewChild fails fast
    
    If Forkit is dead, getNewChild will fail fast.
    
    Try not to busy loop in that case and yield
    the CPU for a nominal duration, which currently
    is the tenth of the normal getNewChild timeout.
    
    Change-Id: I1a94dfedbf2a4f4fc12e4d33d1307f70c307987a
    Reviewed-on: https://gerrit.libreoffice.org/39248
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>
    (cherry picked from commit 8689d11f5cb27f84ec8c49ad7b87abae4b48bee0)
    Reviewed-on: https://gerrit.libreoffice.org/39250
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 6eaf0d10..c44d0d65 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -194,6 +194,9 @@ void DocumentBroker::pollThread()
             std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() -
                                                                   _threadStart).count() > timeoutMs)
             break;
+
+        // Nominal time between retries, lest we  busy-loop. getNewChild could also wait, so don't double that here.
+        std::this_thread::sleep_for(std::chrono::milliseconds(CHILD_REBALANCE_INTERVAL_MS / 10));
     }
     while (!_stop && _poll->continuePolling() && !TerminationFlag && !ShutdownRequestFlag);
 


More information about the Libreoffice-commits mailing list