[Libreoffice-commits] online.git: wsd/DocumentBroker.hpp

Gabriel Masei (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 12 15:28:28 UTC 2020


 wsd/DocumentBroker.hpp |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 3046c5748bb54b16738aa5a7ee5e90b9420d68ac
Author:     Gabriel Masei <gabriel.masei at 1and1.ro>
AuthorDate: Tue Feb 11 17:51:20 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Feb 12 16:28:10 2020 +0100

    Fix removal of kit procs when they are blocked
    
    Change-Id: Ifa2a2a56a305e33bb07ad622fce14f0e8b3e83eb
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88464
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 890e89e38..8b2b42551 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -119,14 +119,23 @@ public:
 
             // Shutdown the socket.
             if (_ws)
+            {
                 _ws->shutdown();
+                // If socket was shutdown and buffers cleared then there's no
+                // reason to keep the object. This is crucial for DocumentBroker
+                // to be considered as not alive and associated kit process
+                // terminated in cleanupDocBrokers. Otherwise if kit process
+                // hangs then the asociated DocumentBroker object won't be
+                // removed and kit process won't be forcefully terminated. This
+                // is in conjunction with not clearing _pid data member which
+                // is needed later in call to terminate().
+                _ws.reset();
+            }
         }
         catch (const std::exception& ex)
         {
             LOG_ERR("Error while closing child process: " << ex.what());
         }
-
-        _pid = -1;
     }
 
     /// Kill or abandon the child.


More information about the Libreoffice-commits mailing list