diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-05-09 12:10:30 +0200 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2023-05-09 12:10:56 +0200 |
commit | 0e727a66b13e9b670365e7aab2e6179181860f1f (patch) | |
tree | 270e0aaf534d80d07fa8aac5585c38908570a6f9 | |
parent | 3ab2461a78c2963bd687bede4b21f6006e96da2c (diff) | |
parent | 0613ac0e81cb6fc656e12712e2fad729355a9b98 (diff) |
Merge branch 'stable-3.7' into stable-3.8
* stable-3.7:
Set version to 3.7.4-SNAPSHOT
Set version to 3.7.3
Set version to 3.5.7-SNAPSHOT
Set version to 3.5.6
Move creation of PerThreadCache to SshCommand
Update bouncycastle to 1.72
Align commons-compress and tukaani-xz versions with jgit
Bump JGit to 74fa245b3
Bump JGit to 45de4fa
Log external ID differential cache loader failure
ProjectState: simplify the 'getPluginConfig' method
Release-Notes: skip
Change-Id: I5e2c6918eb41febe921e96f3612a3f3530f1aae4
-rw-r--r-- | java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java | 15 | ||||
-rw-r--r-- | java/com/google/gerrit/server/project/ProjectState.java | 10 | ||||
-rw-r--r-- | java/com/google/gerrit/server/query/change/OutputStreamQuery.java | 3 | ||||
-rw-r--r-- | java/com/google/gerrit/sshd/SshCommand.java | 4 | ||||
-rw-r--r-- | polygerrit-ui/app/BUILD | 2 | ||||
-rw-r--r-- | tools/deps.bzl | 4 |
6 files changed, 25 insertions, 13 deletions
diff --git a/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java b/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java index 1edb28409f..8b53d703c8 100644 --- a/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java +++ b/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java @@ -43,7 +43,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import org.eclipse.jgit.errors.ConfigInvalidException; +import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectReader; @@ -184,8 +186,17 @@ public class ExternalIdCacheLoader { } } - AllExternalIds allExternalIds = - buildAllExternalIds(repo, oldExternalIds, additions, removals); + AllExternalIds allExternalIds; + try { + allExternalIds = buildAllExternalIds(repo, oldExternalIds, additions, removals); + } catch (IllegalArgumentException e) { + Set<String> additionKeys = + additions.keySet().stream().map(AnyObjectId::getName).collect(Collectors.toSet()); + logger.atSevere().withCause(e).log( + "Failed to load external ID cache. Repository ref is %s, cache ref is %s, additions are %s", + extIdRef.getObjectId().getName(), parentWithCacheValue.getId().getName(), additionKeys); + throw e; + } reloadCounter.increment(true); reloadDifferential.record(System.nanoTime() - start, TimeUnit.NANOSECONDS); return allExternalIds; diff --git a/java/com/google/gerrit/server/project/ProjectState.java b/java/com/google/gerrit/server/project/ProjectState.java index 9899a6d52b..a3f8009dba 100644 --- a/java/com/google/gerrit/server/project/ProjectState.java +++ b/java/com/google/gerrit/server/project/ProjectState.java @@ -476,19 +476,19 @@ public class ProjectState { * {@code PluginConfig#withInheritance(ProjectState.Factory)} */ public PluginConfig getPluginConfig(String pluginName) { - if (getConfig().getPluginConfigs().containsKey(pluginName)) { - Config config = new Config(); + Config config = new Config(); + String cachedPluginConfig = getConfig().getPluginConfigs().get(pluginName); + if (cachedPluginConfig != null) { try { - config.fromText(getConfig().getPluginConfigs().get(pluginName)); + config.fromText(cachedPluginConfig); } catch (ConfigInvalidException e) { // This is OK to propagate as IllegalStateException because it's a programmer error. // The config was converted to a String using Config#toText. So #fromText must not // throw a ConfigInvalidException throw new IllegalStateException("invalid plugin config for " + pluginName, e); } - return PluginConfig.create(pluginName, config, getConfig()); } - return PluginConfig.create(pluginName, new Config(), getConfig()); + return PluginConfig.create(pluginName, config, getConfig()); } public Optional<BranchOrderSection> getBranchOrderSection() { diff --git a/java/com/google/gerrit/server/query/change/OutputStreamQuery.java b/java/com/google/gerrit/server/query/change/OutputStreamQuery.java index 716cf106d2..961404adb7 100644 --- a/java/com/google/gerrit/server/query/change/OutputStreamQuery.java +++ b/java/com/google/gerrit/server/query/change/OutputStreamQuery.java @@ -30,7 +30,6 @@ import com.google.gerrit.index.query.QueryParseException; import com.google.gerrit.index.query.QueryResult; import com.google.gerrit.server.DynamicOptions; import com.google.gerrit.server.account.AccountAttributeLoader; -import com.google.gerrit.server.cache.PerThreadCache; import com.google.gerrit.server.config.TrackingFooters; import com.google.gerrit.server.data.ChangeAttribute; import com.google.gerrit.server.data.PatchSetAttribute; @@ -211,7 +210,7 @@ public class OutputStreamQuery { return; } - try (PerThreadCache ignored = PerThreadCache.create()) { + try { final QueryStatsAttribute stats = new QueryStatsAttribute(); stats.runTimeMilliseconds = TimeUtil.nowMs(); diff --git a/java/com/google/gerrit/sshd/SshCommand.java b/java/com/google/gerrit/sshd/SshCommand.java index 9df263b860..a4e427d1eb 100644 --- a/java/com/google/gerrit/sshd/SshCommand.java +++ b/java/com/google/gerrit/sshd/SshCommand.java @@ -23,6 +23,7 @@ import com.google.gerrit.server.DynamicOptions; import com.google.gerrit.server.InvalidDeadlineException; import com.google.gerrit.server.RequestInfo; import com.google.gerrit.server.RequestListener; +import com.google.gerrit.server.cache.PerThreadCache; import com.google.gerrit.server.cancellation.RequestCancelledException; import com.google.gerrit.server.cancellation.RequestStateContext; import com.google.gerrit.server.config.GerritServerConfig; @@ -62,7 +63,8 @@ public abstract class SshCommand extends BaseCommand { public void start(ChannelSession channel, Environment env) throws IOException { startThread( () -> { - try (DynamicOptions pluginOptions = new DynamicOptions(injector, dynamicBeans)) { + try (PerThreadCache ignored = PerThreadCache.create(); + DynamicOptions pluginOptions = new DynamicOptions(injector, dynamicBeans)) { parseCommandLine(pluginOptions); stdout = toPrintWriter(out); stderr = toPrintWriter(err); diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD index 6df4456415..925820cc54 100644 --- a/polygerrit-ui/app/BUILD +++ b/polygerrit-ui/app/BUILD @@ -180,9 +180,9 @@ filegroup( "**/*_test.ts", ], ) + [ + "@npm//typescript", "@ui_dev_npm//:node_modules", "@ui_npm//:node_modules", - "@npm//typescript", ], ) diff --git a/tools/deps.bzl b/tools/deps.bzl index 83044c934b..7d4499a7c8 100644 --- a/tools/deps.bzl +++ b/tools/deps.bzl @@ -121,8 +121,8 @@ def java_dependencies(): # When upgrading commons-compress, also upgrade tukaani-xz maven_jar( name = "commons-compress", - artifact = "org.apache.commons:commons-compress:1.20", - sha1 = "b8df472b31e1f17c232d2ad78ceb1c84e00c641b", + artifact = "org.apache.commons:commons-compress:1.22", + sha1 = "691a8b4e6cf4248c3bc72c8b719337d5cb7359fa", ) maven_jar( |