[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-7' - loolwsd/LOOLWSD.cpp

Henry Castro hcastro at collabora.com
Mon Jan 25 13:23:49 PST 2016


 loolwsd/LOOLWSD.cpp |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 38e3da41c833855711c8c02987fb2bbcf5ffbe03
Author: Henry Castro <hcastro at collabora.com>
Date:   Mon Jan 25 17:23:01 2016 -0400

    loolwsd: Log::warn when the thread pool is full
    
    When thread pool is full no more connections are accepted.
    It is confused as a deadlock

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 0440430..db2ccac 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1384,8 +1384,19 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
         waitForTerminationRequest();
     }
 
+    std::chrono::steady_clock::time_point lastPoolTime = std::chrono::steady_clock::now();
+
     while (!LOOLWSD::isShutDown && !LOOLWSD::doTest && MasterProcessSession::_childProcesses.size() > 0)
     {
+        const auto duration = (std::chrono::steady_clock::now() - lastPoolTime);
+        if (duration >= std::chrono::seconds(10))
+        {
+            if (threadPool.available() ==  0)
+                std::cout << Util::logPrefix() << "The thread pool is full, no more connections are accepted." << std::endl;
+
+            lastPoolTime = std::chrono::steady_clock::now();
+        }
+
         pid_t pid = waitpid(-1, &status, WUNTRACED | WNOHANG);
         if (pid > 0)
         {


More information about the Libreoffice-commits mailing list