diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-07-24 18:57:20 -0400 |
---|---|---|
committer | cobackporter[bot] <cobackporter[bot]@users.noreply.github.com> | 2022-07-26 02:47:51 +0000 |
commit | cd5d6c3c9b064bc2046d102c31caf378ca7a29ab (patch) | |
tree | 9ea38b08de56a0801d1d393e1abee84fb33be855 | |
parent | wsd: invoke handlePoll on all sockets (diff) | |
download | online-backport/5056/distro/collabora/co-21-11.tar.gz online-backport/5056/distro/collabora/co-21-11.zip |
wsd: correctly stop DocBroker from interactive mode
backport/5056/distro/collabora/co-21-11
When in interactive mode, the user has a dialog
to interact with. The issue is that the user may
dismiss said dialog, the Kit process may stop,
crash, or otherwise exit. This basically leaves
DocBroker in a deadlocked state, expecting
input from the interactive document, which
will never materialize.
Here, we rely on the machinery already in place
for flagging such a DocBroker that has no Kit.
We check for said flag and stop DocBroker if
such a case is detected, exiting clearly.
Change-Id: Iecb91c49226da08567cdd2c5d050d458e2f0fc9b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
-rw-r--r-- | wsd/DocumentBroker.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index bbae035b01..13331147cb 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -288,6 +288,15 @@ void DocumentBroker::pollThread() if (isInteractive()) { + // It is possible to dismiss the interactive dialog, + // exit the Kit process, or even crash. We would deadlock. + if (isUnloading()) + { + // We expect to have either isMarkedToDestroy() or + // isCloseRequested() in that case. + stop("abortedinteractive"); + } + // Extend the deadline while we are interactiving with the user. loadDeadline = now + std::chrono::seconds(limit_load_secs); continue; |