diff --git a/Documentation/metrics.txt b/Documentation/metrics.txt index 903dc73a21..7e6799be1b 100644 --- a/Documentation/metrics.txt +++ b/Documentation/metrics.txt @@ -54,6 +54,8 @@ objects needing finalization. * `proc/jvm/thread/num_daemon_live`: Current live daemon threads count. * `proc/jvm/thread/num_peak_live`: Peak live thread count since the Java virtual machine started or peak was reset. * `proc/jvm/thread/num_total_started`: Total number of threads created and also started since the Java virtual machine started. +* `proc/jvm/thread/num_deadlocked_threads`: Number of threads that are deadlocked waiting for object monitors or ownable synchronizers. + If deadlocks waiting for ownable synchronizers can be monitored depends on the capabilities of the used JVM. === Caches diff --git a/Documentation/rest-api-plugins.txt b/Documentation/rest-api-plugins.txt index c34fe77ee2..77b180e1c6 100644 --- a/Documentation/rest-api-plugins.txt +++ b/Documentation/rest-api-plugins.txt @@ -246,7 +246,7 @@ List all plugins that match substring `project`: [[install-plugin]] === Install Plugin -- -'PUT /plugins/link:#plugin-id[\{plugin-id\}]' +'PUT /plugins/link:#plugin-id[\{plugin-id\}].jar' -- Installs a new plugin on the Gerrit server. If a plugin with the @@ -260,7 +260,7 @@ a link:#plugin-input[PluginInput] entity. .Request ---- - PUT /plugins/delete-project HTTP/1.0 + PUT /plugins/delete-project.jar HTTP/1.0 Content-Type: application/json; charset=UTF-8 { @@ -272,7 +272,7 @@ To provide the plugin jar as binary data in the request body the following curl command can be used: ---- - curl --user admin:TNNuLkWsIV8w -X PUT --data-binary @delete-project-2.8.jar 'http://gerrit:8080/a/plugins/delete-project' + curl --user admin:TNNuLkWsIV8w -X PUT -H "Content-Type:application/octet-stream" --data-binary @delete-project.jar 'http://gerrit:8080/a/plugins/delete-project.jar' ---- As response a link:#plugin-info[PluginInfo] entity is returned that @@ -282,12 +282,15 @@ describes the plugin. ---- HTTP/1.1 201 Created Content-Disposition: attachment - Content-Type: application/json; charset=UTF-8 + Content-Type: application/json;charset=utf-8 + Content-Length: 150 )]}' { "id": "delete-project", - "version": "2.8" + "version": "v2.16-221-g35bb8bbac4", + "index_url": "plugins/delete-project/", + "filename": "delete-project.jar" } ---- diff --git a/WORKSPACE b/WORKSPACE index 5f1fbff6aa..555f5b1f7a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -267,7 +267,7 @@ maven_jar( CAFFEINE_GUAVA_SHA256 = "3a66ee3ec70971dee0bae6e56bda7b8742bc4bedd7489161bfbbaaf7137d89e1" # TODO(davido): Rename guava.jar to caffeine-guava.jar on fetch to prevent potential -# naming collision between caffeine guava adapater and guava library itself. +# naming collision between caffeine guava adapter and guava library itself. # Remove this renaming procedure, once this upstream issue is fixed: # https://github.com/ben-manes/caffeine/issues/364. http_file( diff --git a/java/com/google/gerrit/httpd/ProjectBasicAuthFilter.java b/java/com/google/gerrit/httpd/ProjectBasicAuthFilter.java index d43fcc75f4..111cc34676 100644 --- a/java/com/google/gerrit/httpd/ProjectBasicAuthFilter.java +++ b/java/com/google/gerrit/httpd/ProjectBasicAuthFilter.java @@ -15,6 +15,7 @@ package com.google.gerrit.httpd; import static java.nio.charset.StandardCharsets.UTF_8; +import static javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE; import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED; import com.google.common.base.MoreObjects; @@ -33,6 +34,7 @@ import com.google.gerrit.server.account.AuthRequest; import com.google.gerrit.server.account.AuthResult; import com.google.gerrit.server.account.AuthenticationFailedException; import com.google.gerrit.server.account.externalids.PasswordVerifier; +import com.google.gerrit.server.auth.AuthenticationUnavailableException; import com.google.gerrit.server.auth.NoSuchUserException; import com.google.gerrit.server.config.AuthConfig; import com.google.inject.Inject; @@ -170,6 +172,10 @@ class ProjectBasicAuthFilter implements Filter { logger.atWarning().log(authenticationFailedMsg(username, req) + ": %s", e.getMessage()); rsp.sendError(SC_UNAUTHORIZED); return false; + } catch (AuthenticationUnavailableException e) { + logger.atSevere().withCause(e).log("could not reach authentication backend"); + rsp.sendError(SC_SERVICE_UNAVAILABLE); + return false; } catch (AccountException e) { logger.atWarning().withCause(e).log(authenticationFailedMsg(username, req)); rsp.sendError(SC_UNAUTHORIZED); diff --git a/java/com/google/gerrit/metrics/proc/ProcMetricModule.java b/java/com/google/gerrit/metrics/proc/ProcMetricModule.java index fced1783c6..20ac8fa908 100644 --- a/java/com/google/gerrit/metrics/proc/ProcMetricModule.java +++ b/java/com/google/gerrit/metrics/proc/ProcMetricModule.java @@ -234,5 +234,36 @@ public class ProcMetricModule extends MetricModule { .setGauge() .setUnit("threads"), thread::getTotalStartedThreadCount); + if (thread.isSynchronizerUsageSupported()) { + metrics.newCallbackMetric( + "proc/jvm/thread/num_deadlocked_threads", + Integer.class, + new Description( + "number of threads that are deadlocked waiting for object monitors or ownable synchronizers") + .setGauge() + .setUnit("threads"), + () -> { + long[] deadlocked = thread.findDeadlockedThreads(); + if (deadlocked == null) { + return 0; + } + return deadlocked.length; + }); + } else { + metrics.newCallbackMetric( + "proc/jvm/thread/num_deadlocked_threads", + Integer.class, + new Description( + "number of threads that are deadlocked waiting to acquire object monitors") + .setGauge() + .setUnit("threads"), + () -> { + long[] deadlocked = thread.findMonitorDeadlockedThreads(); + if (deadlocked == null) { + return 0; + } + return deadlocked.length; + }); + } } } diff --git a/java/com/google/gerrit/server/change/ChangeKindCacheImpl.java b/java/com/google/gerrit/server/change/ChangeKindCacheImpl.java index 682b46c10c..1e149548db 100644 --- a/java/com/google/gerrit/server/change/ChangeKindCacheImpl.java +++ b/java/com/google/gerrit/server/change/ChangeKindCacheImpl.java @@ -344,10 +344,12 @@ public class ChangeKindCacheImpl implements ChangeKindCache { ObjectId next) { try { Key key = Key.create(prior, next, useRecursiveMerge); - return cache.get(key, new Loader(key, repoManager, project, rw, repoConfig)); + ChangeKind kind = cache.get(key, new Loader(key, repoManager, project, rw, repoConfig)); + logger.atFine().log("Change kind of new patch set %s in %s: %s", next.name(), project, kind); + return kind; } catch (ExecutionException e) { logger.atWarning().withCause(e).log( - "Cannot check trivial rebase of new patch set %s in %s", next.name(), project); + "Cannot check change kind of new patch set %s in %s", next.name(), project); return ChangeKind.REWORK; } } @@ -400,6 +402,8 @@ public class ChangeKindCacheImpl implements ChangeKindCache { patch.number(), change.getId()); } } + logger.atFine().log( + "Change kind for patchSet %s of change %s: %s", patch.number(), change.getId(), kind); return kind; } @@ -426,6 +430,8 @@ public class ChangeKindCacheImpl implements ChangeKindCache { patch.number(), change.getChangeId()); } } + logger.atFine().log( + "Change kind for patchSet %s of change %s: %s", patch.number(), change.getChangeId(), kind); return kind; } } diff --git a/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.js b/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.js index d2fde51c3b..36e2cc498c 100644 --- a/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.js +++ b/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list.js @@ -123,8 +123,13 @@ class GrAdminGroupList extends mixinBehaviors( [ } } + /** + * Generates groups link (/admin/groups/) + * + * @param {string} id + */ _computeGroupUrl(id) { - return GerritNav.getUrlForGroup(id); + return GerritNav.getUrlForGroup(decodeURIComponent(id)); } _getCreateGroupCapability() { diff --git a/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list_html.js b/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list_html.js index 136f6b68b4..4548a4511e 100644 --- a/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list_html.js +++ b/polygerrit-ui/app/elements/admin/gr-admin-group-list/gr-admin-group-list_html.js @@ -48,7 +48,7 @@ export const htmlTemplate = html`