From d14b1b34bafc7cc82383e8032f3adb626747849b Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Tue, 1 Mar 2022 17:54:22 +0200 Subject: Add support for parallel extraction of component archives Introduce ConcurrentOperationRunner class used for running installer operations concurrently in the global thread pool. Add execution groups for operations; Unpack operations are run concurrently for all components requesting installation, operations belonging to Install group are run sequentially for sorted components one at a time as before. From the default registered operations the Extract op is moved to Unpack group. Move the previously on-the-fly backup steps of Extract operation to the ExtractArchiveOperation::backup(), so that backups are done before any archives are extracted, and that we know if any of the archives requires administrator privileges to unpack. Reparent QInstaller::Error to QException to support throwing and catching exceptions across thread boundaries. Use RAII for the server-side objects of the classes supporting the remote client-server protocol of installer framework. The concurrent extraction revealed that it was still possible that the local socket was disconnected and thus the RemoteServer- Connection thread finished before receiving and processing the final "Destroy" command packet, leaking the dynamically allocated objects. Task-number: QTIFW-2566 Change-Id: Ib8c2928b9405b7b3465c731018df73acb51e949f Reviewed-by: Leena Miettinen Reviewed-by: Katja Marttila --- doc/includes/IFWDoc | 2 ++ doc/operations.qdoc | 11 +++++++++++ doc/scripting.qdoc | 1 + 3 files changed, 14 insertions(+) (limited to 'doc') diff --git a/doc/includes/IFWDoc b/doc/includes/IFWDoc index 918d6df52..936a6812e 100644 --- a/doc/includes/IFWDoc +++ b/doc/includes/IFWDoc @@ -15,6 +15,7 @@ #include "componentchecker.h" #include "component.h" #include "componentmodel.h" +#include "concurrentoperationrunner.h" #include "constants.h" #include "consumeoutputoperation.h" #include "copydirectoryoperation.h" @@ -30,6 +31,7 @@ #include "errors.h" #include "extractarchiveoperation.h" #include "fakestopprocessforupdateoperation.h" +#include "fileguard.h" #include "fileio.h" #include "fileutils.h" #include "globalsettingsoperation.h" diff --git a/doc/operations.qdoc b/doc/operations.qdoc index 68662d289..c61e2af0c 100644 --- a/doc/operations.qdoc +++ b/doc/operations.qdoc @@ -300,4 +300,15 @@ devtool operation DO,Copy,, \endcode + \section1 Execution Groups + + The operations owned by a component belong to either of two groups: \e Unpack or \e Install. + The \c Extract operations are performed as part of the \e Unpack group before all other + operations and executed concurrently between all components that are going + to be installed. The rest of the operations are performed in the \e Install group and + executed sequentially for each component at a time. + + Custom operations can define their execution group by calling the \c setGroup() method + in their constructor. For more information about custom operations, see + \l{Registering Custom Operations}. */ diff --git a/doc/scripting.qdoc b/doc/scripting.qdoc index d196bf8fb..bb547a0d6 100644 --- a/doc/scripting.qdoc +++ b/doc/scripting.qdoc @@ -147,6 +147,7 @@ CustomOperation() { setName( "CustomOperation" ); + setGroup( Install ); } void backup() -- cgit v1.2.3