RETIRED, Gerrit as used by OpenStack
Go to file
Han-Wen Nienhuys 405a8f53d3 in WorkQueue, explicitly cancel Runnables that are Futures.
In LuceneChangeIndex, we schedule the future by calling (essentially)

  MoreExecutors.listeningDecorator(threadPool).submit()

this returns a TrustedListenableFutureTask, a Future implemented by
Guava, and we wait on this one.

The implementation passes this off to ScheduledThreadPoolExecutor for
running. This interprets it as a Runnable in
AbstractExecutorService#submit(), and a Runnable has no call surface
for cancellation. This means that the guava future is never canceled
if the corresponding ScheduledFutureTask is canceled.

Server#stop shuts down all thread pools. Since the pools are created
with

    setExecuteExistingDelayedTasksAfterShutdownPolicy(false)

all pending work is canceled.

The problem would trigger in the following circumstances:

 * For tests that schedule two or more ref updates at the end of the
   test. Since the interactive pool has size 1, that could delay a
   piece of work to be delayed.

 * Executors are shutdown in creation order, which is random. It would
   only trigger if the interactive pool was shutdown before the batch
   pool.

The problem could be reliably reproduced by building with Bazel,
setting shard_count=30 on
//gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/rest/project:rest_project,
and running shard 10 (which exhibited the problem) 50-way parallel on
a 12 HT-core system.

Things to note:

* If we have to use ListenableFutures, then it would be nice if we
  could use a Executor that actually works together well with Guava.

* Server#stop discards pending work. In particular, work scheduled by
  ReindexAfterUpdate can be discarded, potentially leaving the index
  inconsistent.

* ReindexAfterUpdate runs in the batch executor, but then schedules
  its search work on the interactive executor, which is gratuitously
  parallel.

* WorkQueue.Executor is a lot of cognitive overhead for providing a
  list of processes. Can't administrators just run jstack?

* A randomized creation order for threadpools causes randomized
  shutdown order, making problems harder to reproduce.

Bug: Issue 4466
Change-Id: I55c3b85c66433de7ee9e037fc243abe705080bbc
2016-10-13 18:31:28 +00:00
.settings Build with Java 8 2016-09-20 10:19:52 +02:00
bucklets Buck: Fix typo in gerrit_plugin.bucklet 2015-12-23 17:55:11 +01:00
contrib Improve populate-fixture-data script 2016-10-10 10:51:07 +02:00
Documentation Merge "Support specifying the parent for a cherry-pick in the REST API" 2016-10-13 09:07:00 +00:00
gerrit-acceptance-framework RestSession: Support anonymous session 2016-10-06 16:28:23 -04:00
gerrit-acceptance-tests Merge "Support specifying the parent for a cherry-pick in the REST API" 2016-10-13 09:07:00 +00:00
gerrit-antlr Implement Bazel build 2016-06-14 21:12:02 +02:00
gerrit-cache-h2 Support for setting diskLimit from CacheModule bindings 2016-09-22 22:51:33 +02:00
gerrit-common Show and highlight assignees in change table 2016-09-23 09:39:24 +02:00
gerrit-elasticsearch ElasticChangeIndex: Remove redundant 'public' modifier on constructor 2016-10-03 13:31:04 +09:00
gerrit-extension-api Support specifying the parent for a cherry-pick in the REST API 2016-10-13 10:42:48 +02:00
gerrit-gpg Use some Java 8 features 2016-09-20 15:39:47 -04:00
gerrit-gwtdebug Bump GWT version to 2.8.0-rc2 2016-09-19 15:10:11 +02:00
gerrit-gwtexpui Build a Recommender for Reviewer Suggestion 2016-10-12 16:51:58 +02:00
gerrit-gwtui Build a Recommender for Reviewer Suggestion 2016-10-12 16:51:58 +02:00
gerrit-gwtui-common Build a Recommender for Reviewer Suggestion 2016-10-12 16:51:58 +02:00
gerrit-httpd Fix RunAsFilter and add tests 2016-10-06 16:49:09 -04:00
gerrit-index bazel: update for elasticsearch and lucene. 2016-09-28 21:17:08 +02:00
gerrit-launcher Merge changes from topic 'win32' 2016-09-23 12:12:11 +00:00
gerrit-lucene bazel: update for elasticsearch and lucene. 2016-09-28 21:17:08 +02:00
gerrit-main Merge changes from topic 'bazel-build' 2016-09-20 11:57:48 +00:00
gerrit-oauth Implement Bazel build 2016-06-14 21:12:02 +02:00
gerrit-openid Move AuthType from gerrit-reviewdb to extension API 2016-08-23 17:27:50 +09:00
gerrit-patch-commonsnet Merge branch 'stable-2.12' 2016-08-18 09:09:43 -04:00
gerrit-patch-jgit Update Buck to latest version 2016-09-20 13:19:15 +02:00
gerrit-pgm Enable plugins.allowRemoteAdmin in developer mode 2016-10-12 08:37:01 +00:00
gerrit-plugin-api Set version to 2.13.1 2016-09-23 14:28:31 +02:00
gerrit-plugin-archetype Set version to 2.13.1 2016-09-23 14:28:31 +02:00
gerrit-plugin-gwt-archetype Set version to 2.13.1 2016-09-23 14:28:31 +02:00
gerrit-plugin-gwtui Set version to 2.13.1 2016-09-23 14:28:31 +02:00
gerrit-plugin-js-archetype Build with Java 8 2016-09-20 10:19:52 +02:00
gerrit-prettify bazel: genasciidoc and genasciidoc_zip rule 2016-10-07 15:20:35 +08:00
gerrit-reviewdb ChangeNotes: Make defensive copies of mutable value types 2016-10-11 17:10:33 -04:00
gerrit-server in WorkQueue, explicitly cancel Runnables that are Futures. 2016-10-13 18:31:28 +00:00
gerrit-sshd Merge branch 'stable-2.13' 2016-09-23 16:02:53 +02:00
gerrit-util-cli Implement Bazel build 2016-06-14 21:12:02 +02:00
gerrit-util-http Convert some Functions/Predicates to streams & lambdas (5) 2016-09-21 04:27:43 -04:00
gerrit-util-ssl Implement Bazel build 2016-06-14 21:12:02 +02:00
gerrit-war bazel: update for elasticsearch and lucene. 2016-09-28 21:17:08 +02:00
lib Merge "bazel: pass down **kwargs for some bzl macros." 2016-10-13 00:01:31 +00:00
plugins Update git submodules 2016-10-13 15:00:58 +00:00
polygerrit-ui Update keyboard shortcuts dialog to account for new actions 2016-10-12 17:47:47 -07:00
ReleaseNotes Add ReleaseNotes/BUILD 2016-10-07 15:20:35 +08:00
tools Remove explicit dependency on jimfs in Eclipse classpath 2016-10-13 09:59:58 +09:00
website/releases Fix Diffy logo on release page by encoding the image 2015-12-29 10:36:39 -08:00
.bazelrc bazel: generate the workspace version from the volatile status. 2016-09-27 15:01:24 +02:00
.buckconfig Merge branch 'stable-2.13' 2016-09-21 11:35:53 +02:00
.buckversion Update buck to latest version 2016-10-04 14:18:47 +09:00
.editorconfig Added continuation indent to editorconfig 2016-04-26 14:42:58 +02:00
.gitignore Ignore .metadata folder managed by Eclipse 2016-10-04 12:06:17 +02:00
.gitmodules Adapt .gitmodules to enable superproject subscriptions 2016-07-27 12:01:40 -07:00
.mailmap Update mailmap 2016-09-23 11:02:35 +02:00
.pydevproject Update PyDev project to use Python 2.7 2014-10-02 15:16:44 +09:00
.watchmanconfig Watchman: Add eclipse-out to ignored directories 2016-01-22 08:04:24 +01:00
BUCK Buck: Build gwtgerrit without touching PolyGerrit deps 2015-12-01 07:29:21 +00:00
BUILD bazel: genasciidoc and genasciidoc_zip rule 2016-10-07 15:20:35 +08:00
COPYING Initial project setup of Gerrit 2 2008-11-14 16:59:34 -08:00
INSTALL Remove Gerrit 1.x to 2.x import tools 2009-03-27 20:20:10 -07:00
README.md Merge branch 'stable-2.12' 2016-06-27 11:08:44 +09:00
SUBMITTING_PATCHES Update push URL in SUBMITTING_PATCHES 2012-03-29 00:57:14 -04:00
VERSION Set version to 2.13.1 2016-09-23 14:28:31 +02:00
WORKSPACE Update bazel build to use Truth 0.30 2016-10-12 16:06:15 +02:00

Gerrit Code Review

Gerrit is a code review and project management tool for Git based projects.

Objective

Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.

Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.

Documentation

For information about how to install and use Gerrit, refer to the documentation.

Source

Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.

Reporting bugs

Please report bugs on the issue tracker.

Contribute

Gerrit is the work of hundreds of contributors. We appreciate your help!

Please read the contribution guidelines.

Note that we do not accept Pull Requests via the Github mirror.

Getting in contact

The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.

The Developer Mailing list is repo-discuss on Google Groups.

License

Gerrit is provided under the Apache License 2.0.

Build

Install Buck and run the following:

    git clone --recursive https://gerrit.googlesource.com/gerrit
    cd gerrit && buck build release

Install binary packages (Deb/Rpm)

The instruction how to configure GerritForge/BinTray repositories is here

On Debian/Ubuntu run:

    apt-get update & apt-get install gerrit=<version>-<release>

NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.

On CentOS/RedHat run:

    yum clean all && yum install gerrit-<version>[-<release>]

NOTE: release is optional. Last released package of the version is installed if the release number is omitted.