loleaflet/src/core/Socket.js | 3 +++ loleaflet/src/errormessages.js | 1 + wsd/DocumentBroker.cpp | 15 +++++++-------- 3 files changed, 11 insertions(+), 8 deletions(-)
New commits: commit d332e1d4a2999da4f93e7831ffc0d58e96fad1c6 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Wed Oct 2 08:38:45 2019 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sat Oct 19 20:56:51 2019 +0200 wsd: notify the client of document load timeout Change-Id: I01052105b8412023ac7651f3a92cc67fe739fd1a Reviewed-on: https://gerrit.libreoffice.org/80325 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index b6c8101d5..c4468543b 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -609,6 +609,9 @@ L.Socket = L.Class.extend({ } else if (errorKind.startsWith('faileddocloading')) { this._map._fatal = true; this._map.fire('error', {msg: errorMessages.faileddocloading}); + } else if (errorKind.startsWith('docloadtimeout')) { + this._map._fatal = true; + this._map.fire('error', {msg: errorMessages.docloadtimeout}); } else if (errorKind.startsWith('docunloading')) { // The document is unloading. Have to wait a bit. this._map._active = false; diff --git a/loleaflet/src/errormessages.js b/loleaflet/src/errormessages.js index e6eff9365..a14fa57b1 100644 --- a/loleaflet/src/errormessages.js +++ b/loleaflet/src/errormessages.js @@ -21,6 +21,7 @@ errorMessages.wrongwopisrc = _('Wrong or missing WOPISrc parameter, please conta errorMessages.sessionexpiry = _('Your session will expire in %time. Please save your work and refresh the session (or webpage) to continue.'); errorMessages.sessionexpired = _('Your session has been expired. Further changes to document might not be saved. Please refresh the session (or webpage) to continue.'); errorMessages.faileddocloading = _('Failed to load the document. Please ensure the file type is supported and not corrupted, and try again.'); +errorMessages.docloadtimeout = _('Failed to load the document. This document is either malformed or is taking more resources than allowed. Please contact the administrator.'); errorMessages.storage = { loadfailed: _('Failed to read document from storage. Please contact your storage server (%storageserver) administrator.'), diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index fd4120611..ed64b93ef 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -283,21 +283,20 @@ void DocumentBroker::pollThread() if (!_isLoaded && (limit_load_secs > 0) && (now > loadDeadline)) { // Brutal but effective. + LOG_WRN("Doc [" << _docKey << "] is taking too long to load. Will kill process [" + << _childProcess->getPid() << "]. per_document.limit_load_secs set to " + << limit_load_secs << " secs."); + broadcastMessage("error: cmd=load kind=docloadtimeout"); + if (_childProcess) - { - LOG_WRN("Doc [" << _docKey << "] is taking too long to load. Will kill process [" - << _childProcess->getPid() - << "]. per_document.limit_load_secs set to " << limit_load_secs - << " secs."); _childProcess->terminate(); - } stop("Load timed out"); continue; } if (std::chrono::duration_cast<std::chrono::milliseconds> - (now - lastBWUpdateTime).count() >= 5 * 1000) + (now - lastBWUpdateTime).count() >= COMMAND_TIMEOUT_MS) { lastBWUpdateTime = now; uint64_t sent, recv; @@ -307,9 +306,9 @@ void DocumentBroker::pollThread() // connection drop transiently reduces this. (sent > adminSent ? (sent - adminSent): uint64_t(0)), (recv > adminRecv ? (recv - adminRecv): uint64_t(0))); - LOG_DBG("Doc [" << _docKey << "] added sent: " << sent << " recv: " << recv << " bytes to totals"); adminSent = sent; adminRecv = recv; + LOG_TRC("Doc [" << _docKey << "] added stats sent: " << sent << ", recv: " << recv << " bytes to totals."); } #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits