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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Nov 23 14:45:00 UTC 2016


 loolwsd/LOOLWSD.cpp |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 430e0cf0215b29502039092aa4c420b87a6bb7b4
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Nov 23 08:54:09 2016 -0500

    loolwsd: alert users of low disk space after loading
    
    Change-Id: I01426aafb353ac8e291969936afc4d276898f0f0
    Reviewed-on: https://gerrit.libreoffice.org/31121
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 5fdff72..5ca3fce 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -892,7 +892,12 @@ private:
             LOG_TRC("Sending to Client [" << status << "].");
             ws->sendFrame(status.data(), status.size());
 
-            FileUtil::checkDiskSpaceOnRegisteredFileSystems();
+            const std::string fs = FileUtil::checkDiskSpaceOnRegisteredFileSystems();
+            if (!fs.empty())
+            {
+                LOG_WRN("File system of " << fs << " dangerously low on disk space");
+                Util::alertAllUsers("error: cmd=internal kind=diskfull");
+            }
 
             // Request the child to connect to us and add this session.
             auto sessionsCount = docBroker->addSession(session);
commit c26e180c081c43d297ba55443e1ce5e9a3cc06b2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Wed Nov 23 09:38:47 2016 -0500

    loolwsd: correct locking of DocBrokers
    
    Change-Id: I52f10e06cf91db451eb34d6540d17db2e0d14385
    Reviewed-on: https://gerrit.libreoffice.org/31120
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index c253f51..5fdff72 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -313,6 +313,7 @@ static bool cleanupChildren()
 /// Called on startup only.
 static void preForkChildren()
 {
+    std::unique_lock<std::mutex> DocBrokersLock(DocBrokersMutex);
     std::unique_lock<std::mutex> lock(NewChildrenMutex);
 
     int numPreSpawn = LOOLWSD::NumPreSpawnedChildren;
@@ -851,8 +852,6 @@ private:
             DocBrokers.insert(it, std::make_pair(docKey, docBroker));
         }
 
-        docBrokersLock.unlock();
-
         // Validate the broker.
         if (!docBroker || !docBroker->isAlive())
         {
@@ -863,6 +862,8 @@ private:
             throw WebSocketErrorMessageException(SERVICE_UNAVAILABLE_INTERNAL_ERROR);
         }
 
+        docBrokersLock.unlock();
+
         // Check if readonly session is required
         bool isReadOnly = false;
         for (const auto& param : uriPublic.getQueryParameters())


More information about the Libreoffice-commits mailing list