Skip to content

Commit

Permalink
wsd: log before killing slow-loading docs
Browse files Browse the repository at this point in the history
Change-Id: I85f045d1431feb51cb9ad093833c32a39ac38215
Reviewed-on: https://gerrit.libreoffice.org/79325
Reviewed-by: Ashod Nakashian <[email protected]>
Tested-by: Ashod Nakashian <[email protected]>
  • Loading branch information
Ashod committed Sep 22, 2019
1 parent 68d834a commit fd5581e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wsd/DocumentBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ void DocumentBroker::pollThread()
auto lastBWUpdateTime = std::chrono::steady_clock::now();
auto lastClipboardHashUpdateTime = std::chrono::steady_clock::now();

int limit_load_secs = LOOLWSD::getConfigValue<int>("per_document.limit_load_secs", 100);
auto loadDeadline = std::chrono::steady_clock::now() + std::chrono::seconds(limit_load_secs);
const int limit_load_secs = LOOLWSD::getConfigValue<int>("per_document.limit_load_secs", 100);
const auto loadDeadline = std::chrono::steady_clock::now() + std::chrono::seconds(limit_load_secs);
#endif
auto last30SecCheckTime = std::chrono::steady_clock::now();

Expand All @@ -294,7 +294,14 @@ void DocumentBroker::pollThread()
{
// Brutal but effective.
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;
}
Expand Down

0 comments on commit fd5581e

Please sign in to comment.