commit | 62f1d7143218c9a6084c135b71d5d2dd8501a2af | [log] [tgz] |
---|---|---|
author | Patrick Hiesel <hiesel@google.com> | Fri Jan 28 11:24:33 2022 +0100 |
committer | Patrick Hiesel <hiesel@google.com> | Fri Jan 28 11:39:53 2022 +0000 |
tree | 75895f0c52309aa71c5c9f530fd575bc5810ed33 | |
parent | 46d29f83ed66750a871881280a85ae4ad3427104 [diff] |
Fix bottleneck in GitRefUpdatedListener The supermanifest plugin listens on Git ref updates using a class marked as @Singleton. This means any and all updates to the Git storage will go through this class. The actual method that handles these updates was marked synchronized to prevent shared access to a non-thread safe config. This turns out to be a central bottleneck in Gerrit: All git updates have to go through this method. If the supermanifest plugin is configured to do work (i.e. update manifest entries for other repos), that work is actually quite slow (5s and sometimes above). This makes it so that updates on the Gerrit server get to a grinding halt and get all queued up on this synchronized block. In this commit, we rework the mutable config to be immutable, remove the synchronized block and swap it for an AtomicReference. With that, the machinery is still thread safe, but doesn't lock up anymore. While at it, we swap a call to ProjectIndex#evictAndReindex for ProjectIndex#evict. We just want to read a fresh project config from disk. Eviction is sufficient for that. Change-Id: I89ffce984d7f4c32dda72dff9e55a5c4c108ee7d
The plugin will update a superproject to contain the submodules defined in the manifest XML file whenever the manifest repo is changed.
For more information see the documentation or the build instructions