[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Henry Castro hcastro at collabora.com
Mon Jan 25 13:10:54 PST 2016


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

New commits:
commit 6b284332656eb2731157a3c88c62517c9d2b78d0
Author: Henry Castro <hcastro at collabora.com>
Date:   Mon Jan 25 17:03:21 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 cd6a89c..a904ffd 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -993,8 +993,19 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
 
     int status = 0;
     unsigned timeoutCounter = 0;
+    std::chrono::steady_clock::time_point lastPoolTime = std::chrono::steady_clock::now();
+
     while (!TerminationFlag && !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)
+                Log::warn("The thread pool is full, no more connections accepted.");
+
+            lastPoolTime = std::chrono::steady_clock::now();
+        }
+
         const pid_t pid = waitpid(-1, &status, WUNTRACED | WNOHANG);
         if (pid > 0)
         {


More information about the Libreoffice-commits mailing list