[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - common/MessageQueue.hpp wsd/DocumentBroker.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Jan 22 17:07:09 UTC 2018
common/MessageQueue.hpp | 1 -
wsd/DocumentBroker.cpp | 10 ++++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 5e17b40a7e38fed00b7322e2d2d8cc0641e627a6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Thu Jan 11 01:29:08 2018 -0500
wsd: save documents before recycling
Reviewed-on: https://gerrit.libreoffice.org/47739
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 5f175c5120fa719563dca6eea625f351bdeada34)
Change-Id: I24afc5c1bceca272f23a129609f73fc5a8d3caf2
Reviewed-on: https://gerrit.libreoffice.org/47740
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/common/MessageQueue.hpp b/common/MessageQueue.hpp
index 2ab30fb1..c3ae0e21 100644
--- a/common/MessageQueue.hpp
+++ b/common/MessageQueue.hpp
@@ -95,7 +95,6 @@ public:
protected:
virtual void put_impl(const Payload& value)
{
- const auto msg = std::string(value.data(), value.size());
_queue.push_back(value);
}
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 876446c4..03d0676b 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -275,6 +275,7 @@ void DocumentBroker::pollThread()
if (ShutdownRequestFlag)
{
+ autoSave(true);
stop("recycling");
}
else if (AutoSaveEnabled && !_stop &&
@@ -299,7 +300,7 @@ void DocumentBroker::pollThread()
LOG_INF("Finished polling doc [" << _docKey << "]. stop: " << _stop << ", continuePolling: " <<
_poll->continuePolling() << ", ShutdownRequestFlag: " << ShutdownRequestFlag <<
- ", TerminationFlag: " << TerminationFlag << ".");
+ ", TerminationFlag: " << TerminationFlag << ", closeReason: " << _closeReason << ". Flushing socket.");
if (_isModified)
{
@@ -321,6 +322,10 @@ void DocumentBroker::pollThread()
_poll->poll(std::min(flushTimeoutMs - elapsedMs, POLL_TIMEOUT_MS / 5));
}
+ LOG_INF("Finished flushing socket for doc [" << _docKey << "]. stop: " << _stop << ", continuePolling: " <<
+ _poll->continuePolling() << ", ShutdownRequestFlag: " << ShutdownRequestFlag <<
+ ", TerminationFlag: " << TerminationFlag << ". Terminating child with reason: [" << _closeReason << "].");
+
// Terminate properly while we can.
terminateChild(_closeReason);
@@ -877,7 +882,8 @@ bool DocumentBroker::autoSave(const bool force)
if (force)
{
LOG_TRC("Sending forced save command for [" << _docKey << "].");
- sent = sendUnoSave(savingSessionId);
+ // Don't terminate editing as this can be invoked by the admin OOM, but otherwise force saving anyway.
+ sent = sendUnoSave(savingSessionId, /*dontTerminateEdit=*/ true, /*dontSaveIfUnmodified=*/ false, /*isAutosave=*/ false);
}
else if (_isModified)
{
More information about the Libreoffice-commits
mailing list