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

New commits:
commit 8689d11f5cb27f84ec8c49ad7b87abae4b48bee0
Author: Ashod Nakashian <ashod.nakash...@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 <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index c9c61d4c..4adfcd89 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -196,6 +196,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);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to