From d134e79fb15b7a97e8cea4e5e13cfebb48729fce Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Sun, 21 Sep 2014 12:31:56 +0200 Subject: [PATCH 1/4] Fix plugin reloading for DynamicItems Since DynamicItems could only ever be loaded by a single plugin at a time (they are singletons), the code enforcing this prevented those plugins from being reloaded. Test Plan: reload the following plugins: * gravatar-avatar-provider * websession-flatfile Bug: issue 2895 Change-Id: I52a07f34d1fa0b756f4cc22d0d83d2ef6906840e (cherry picked from commit 9a5e78aa73fc4cf1159e2bcca95bf11c1f0b5cb5) --- .../gerrit/extensions/registration/DynamicItem.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java index 9ef7d1b783..7edfaed1a9 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java @@ -184,7 +184,13 @@ public class DynamicItem { NamedProvider old = null; while (!ref.compareAndSet(old, item)) { old = ref.get(); - if (old != null && !"gerrit".equals(old.pluginName)) { + if (old != null + && !"gerrit".equals(old.pluginName) + && !pluginName.equals(old.pluginName)) { + // We allow to replace: + // 1. Gerrit core items, e.g. websession cache + // can be replaced by plugin implementation + // 2. Reload of current plugin throw new ProvisionException(String.format( "%s already provided by %s, ignoring plugin %s", this.key.getTypeLiteral(), old.pluginName, pluginName)); From cc1e2457c4524f226d782ae89061f420cfd062d7 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 21 Jan 2015 16:35:19 +0100 Subject: [PATCH 2/4] Update JGit to 3.6.2.201501210735-r This version of JGit logs IOExceptions caught while accessing pack files and only removes affected packs from the pack list if we know that the pack is corrupt. Other IOExceptions could be transient hence JGit doesn't remove the affected pack from the list anymore to avoid the problem reported on the Gerrit list [1]. It looks like in the reported case the pack was removed from the pack list causing MissingObjectExceptions which disappear when the server is restarted. [1] https://groups.google.com/forum/#!topic/repo-discuss/Qdmbl-YZ4NU Bug: issue 3094 Change-Id: I3cf36e1c2000f42652053ada712eccb955e99390 --- lib/jgit/BUCK | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/jgit/BUCK b/lib/jgit/BUCK index 8ddf3f9d01..2d0af1b174 100644 --- a/lib/jgit/BUCK +++ b/lib/jgit/BUCK @@ -1,12 +1,12 @@ include_defs('//lib/maven.defs') -VERS = '3.5.3.201412180710-r' +VERS = '3.6.2.201501210735-r' maven_jar( name = 'jgit', id = 'org.eclipse.jgit:org.eclipse.jgit:' + VERS, - bin_sha1 = '9f3781c7163ee6fa380a4518564a5abb097d9e27', - src_sha1 = 'e6d8548522624ffa3094e43130e5dc958f359187', + bin_sha1 = '47d59dffb5f02470ccfb6c1a5a31b6040a1636e5', + src_sha1 = '52e133360f2c38046de262c827dfec8ec5b7c885', license = 'jgit', unsign = True, deps = [':ewah'], @@ -20,7 +20,7 @@ maven_jar( maven_jar( name = 'jgit-servlet', id = 'org.eclipse.jgit:org.eclipse.jgit.http.server:' + VERS, - sha1 = 'f2678e1feefd8b90b3c47d40ebc2b9426e3b69f4', + sha1 = 'f7788bbd0c0414e856c84ddf353e6f4c62fe1d28', license = 'jgit', deps = [':jgit'], unsign = True, @@ -33,7 +33,7 @@ maven_jar( maven_jar( name = 'jgit-archive', id = 'org.eclipse.jgit:org.eclipse.jgit.archive:' + VERS, - sha1 = '66705b6630a89c9e6e7950798ea2d7f8a4a82cd7', + sha1 = 'ca9da919275dad5ac2844529f4cdccdd919bab5f', license = 'jgit', deps = [':jgit', '//lib/commons:compress', @@ -49,7 +49,7 @@ maven_jar( maven_jar( name = 'junit', id = 'org.eclipse.jgit:org.eclipse.jgit.junit:' + VERS, - sha1 = '47e821761059770dfd3f443dc7f14d5381fb6f4f', + sha1 = 'b7418e19efbeb9490b359c8a921cf32bfc57ebbd', license = 'DO_NOT_DISTRIBUTE', unsign = True, deps = [':jgit'], From 7406197bc98e05f189392734d478b1db6a43d3db Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 22 Jan 2015 10:18:23 +0000 Subject: [PATCH 3/4] Update 2.10 release notes Change-Id: I4590930934f509455ca1fe553d9159ae5eebfff9 --- ReleaseNotes/ReleaseNotes-2.10.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReleaseNotes/ReleaseNotes-2.10.txt b/ReleaseNotes/ReleaseNotes-2.10.txt index 8e428d9edf..f8a549e631 100644 --- a/ReleaseNotes/ReleaseNotes-2.10.txt +++ b/ReleaseNotes/ReleaseNotes-2.10.txt @@ -701,7 +701,7 @@ Upgrades * Update Jetty to 9.2 -* Update JGit to 3.5.3.201412180710-r +* Update JGit to 3.6.2.201501210735-r * Update log4j to 1.2.17 From ada0f08ef1ddb49c8552a24ba5cea249584ed2fd Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 22 Jan 2015 10:45:16 +0000 Subject: [PATCH 4/4] Update 2.10 release notes Change-Id: I6c084fc4834ab3e5665c59cb97c15e4b735e0f7e --- ReleaseNotes/ReleaseNotes-2.10.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReleaseNotes/ReleaseNotes-2.10.txt b/ReleaseNotes/ReleaseNotes-2.10.txt index f8a549e631..0ff5661490 100644 --- a/ReleaseNotes/ReleaseNotes-2.10.txt +++ b/ReleaseNotes/ReleaseNotes-2.10.txt @@ -663,6 +663,9 @@ General ^^^^^^^ +* link:https://code.google.com/p/gerrit/issues/detail?id=2895[Issue 2895]: +Fix reload of plugins that use DynamicItem. + * Invoke `StartPluginListener` and `ReloadPluginListener` only after start/reload is fully done.