Out-of-Process Git

  • Status: Completed

Problem

Builder can be made more resilient against bugs in libgit2 and libgit2-glib by moving the work out of process. While doing so, it would be nice to restructure the APIs into a design that is more convenient to how the APIs work from Builder. This will have the added benefit of allowing us to simplify our testing of the worker process.

Having Git out of process will allow us to recycle the process if it gets out of hand in memory usage due to long running usage of GgitBlobs and other large memory buffer types.

We might want to also remove the use of libgit2-glib and just use libgit2 directly.

Goals

  1. Improve resilience of Builder by protecting against crashes in libgit2.
  2. Allow Builder to be more honest about where memory usage is spent. (Users should see "gnome-builder-git" as the memory culprit rather than the UI process).
  3. Move complex, long running, operations out of the UI process.

Anti-Goals

Affected Modules

  1. Git Plugin (src/plugins/git)
  2. libide-vcs was rewritten to use the new GbpGitClient, IpcGitService, IpcGitRepository, and others

  3. Flatpak plugin was changed to use IdeVcsCloner from git plugin and avoid linking against libgit2-glib

Interfaces

No new interfaces are required.

  1. IdeVcsCloner will need to become an IdeObject for IdeContext access.

Risks

  1. ide_vcs_is_ignored() is fairly performance sensitive. We may want to come up with alternate API design that is friendlier to cross-process operations. This would help other VCS systems too, should we decide to implement them (hg, svn, cvs, etc).

  2. We may need to re-initialize the gnome-builder-git worker after cloning a repository so it gets the new directory.
  3. We will need to edit config options (author, email) from the UI process, possibly just using GKeyFile.

Implementation Details

Apps/Builder/ThreePointThirtyfive/OOPGit (last edited 2019-09-19 01:39:43 by ChristianHergert)