summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-09-18 17:44:02 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-09-18 20:42:32 +0200
commitccf35ce98771cac805aafa58a1bcfaba17c59a12 (patch)
treee12c5658ee3545a1e1ad0d792c0c0549f6ac5a26 /offapi
parent782700c6940341d489eabf00a531cb184941484e (diff)
Make sure --enable-online-update does not leave behind UpdateCheckThread
...which is known to cause test processes to crash during exit. (Also see 5cd04405c6b2d1ee46294ce0696d89d2edc97d16 "Disable automatic onFirstVisibleTask UpdateCheck during CppunitTests", so this commit now covers tests like JunitTests and UITests that start a full soffice process.) The relevant code is already rather complex and incomprehensible; it handles the automatic update check triggered by the onFirstVisibleTask UpdateCheckJob, manually triggered update checks, and downloading of new versions. To avoid regressions in all those various scenarios, I tried to add very targeted code that should only wait for a still running UpdateCheckThread triggered by the automatic onFirstVisibleTask UpdateCheckJob---which is the scenario that caused issues during `make check`. (For a manually triggered update check or download it is probably both less likely that related threads would still run during exit, as the user would likely wait for a response before closing LibreOffice, and less severe if threads would still run during exit, as any resulting crashes would likely be "harmless" and might not even be noticed by the user.) However, I note that this targeted fix does increase the complexity and inscrutability of this code even further... The new code does not actually try to join the UpdateCheckJob---see UpdateCheckThread::join referencing <https://bz.apache.org/ooo/show_bug.cgi?id=73893> "webdav ucp does not implement XCommandProcessor::abort". Rather, it waits for UpdateCheckJob::run to finish (after unblocking at least any m_aCondition.wait calls). This, however, can take a while if the update check's HTTP request is in progress. To be able to use a std::condition_variable (with sane semantics compared to osl::ConditionVariable) in UpdateCheck::waitForUpdateCheckFinished, the corresponding UpdateCheck::m_aMutex had to be changed from a (recursive) osl::Mutex to a std::recursive_mutex one (sticking to a recursive one just to be on the safe side, whether or not the code actually makes use of that). Change-Id: I2726acd33b884b807d840cfee2786fcf45815ad7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103013 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'offapi')
0 files changed, 0 insertions, 0 deletions