Rework threading model
Placeholder issue for efforts to rework the threading model for gnome-software.
Remaining vfuncs to port (as of !1423 (merged)):
Once these vfunc implementations are all ported, and the gs_plugin_*()
g_module_symbol()
-based code is all gone, there are some follow-up improvements which I want to make. It might make sense to split them out to follow-up issues when the time comes:
-
Refactor “vfunc not implemented” code to always return a (distinct) error and let the caller decide whether they care: !1266 (comment 1399606) -
Improve logging and sysprof output for GsPluginJob
instances. Probably add a global list of in-progressGsPluginJobs
, with the aim of making it easier to debug which job is causing a problem, and to expose progress information for background jobs to the UI where needed. (Note: Since !1616 (merged) this has been added asGsJobManager
, but it could be made more useful for debugging.) -
Rework the webapps plugin to not use a worker thread (see discussion). -
Go through each plugin and verify, simplify and document their locking models. For example, once this issue is fixed many plugins will be running entirely out of the main thread, and will no longer need internal locking. -
Pull the appstream plugin ( gs-plugin-appstream.c
) into the core, as appstream is a core dependency of everything we do now (this has changed from when gnome-software was originally written), and all the other plugins depend on it. -
Make the plugins independent from each other by dropping a lot of the remaining gs_plugin_add_rule()
calls. This will allow the plugins to be run in parallel more, which will speed things up. -
Parallelise GsPluginJobRefine
(see the FIXME note ings-plugin-job-refine.c
). -
Improve the plugin API documentation ( $builddir/doc/api/html/api.html
) now that the plugin vfuncs are defined on a class struct rather than just via a well-known name. -
Rework gs_app_get_cancellable()
— it doesn’t make sense to have one cancellable per app, since an app could have multiple pending operations -
Rework gs_app_get_pending_action()
— it doesn’t make sense, as an app could have multiple pending actions (jobs) -
Potentially drop gs_app_set_is_update_downloaded()
because it’s only used by flatpak and is now deprecated -
Potentially drop GS_APP_QUIRK_NEEDS_USER_ACTION
andgs_app_{get,set}_action_screenshot()
because they feel wrong, although the rework done on them in !1616 (merged) might now be sufficient -
Rework how QUEUED_FOR_INSTALL
is implemented: it’s currently handled specially in plugins (such as flatpak and PackageKit), but could probably just be handled globally inGsPluginJobInstallApps
-
Change GsAppQuery:is-source
toGsAppQuery:component-kinds
, which would take a set ofAsComponentKind
values to query for. This would default to a set which represents apps we want to see in the main UI, but it could be changed to (for example){ AS_COMPONENT_KIND_REPOSITORY }
to query for repositories (i.e. whenGsAppQuery:is-source
would have beenGS_APP_QUERY_TRISTATE_TRUE
). This will make the query properties more generic and combinable. -
Rename ‘sources’ to ‘repositories’ throughout the API, to align with the terminology used in appstream.
Edited by Philip Withnall