commit | ed561804ebade686ed4f7372d7a3b2f0b7cb4e29 | [log] [tgz] |
---|---|---|
author | Saša Živkov <sasa.zivkov@sap.com> | Tue Oct 10 16:29:58 2017 +0200 |
committer | Saša Živkov <sasa.zivkov@sap.com> | Wed Oct 18 10:24:42 2017 +0200 |
tree | 350a55fa2cf1e402dcd32ba1082ac28af38c56db | |
parent | 71733250e911b1328faf8d17eb76e69ccd6f9067 [diff] |
Handle concurrent creation of the same project consistently When two requests create the same project, one is expected to succeed with SC_CREATED and another to fail with SC_CONFLICT. This works well when these two requests are executed sequentially. However, when the two requests were executed concurrently, the result was less predictable: * it could be as described above or * one of the requests would randomly fail with an SC_INTERNAL_SERVER_ERROR. Add a test for concurrent project creation. Execute concurrent project creation several times to increase probability of reproducing the issue in the code as it was before this change. Introduce ProjectNameLockManager for locking project names and use it from the CreateProject REST API to synchronize on the same project name. The default implementation of the ProjectNameLockManager uses an in-memory (guava) cache of locks. This is a good implementation for single instance Gerrit servers. Exposes the ProjectNameLockManager as an extension point so that a plugin can provide own implementation. The idea is that the high-availability plugin provides own project name locking based on JGroups cluster wide locking [1] or a kind of file system based locking and thus ensure consistent behaviour when running in active-active mode. Further, the delete-project plugin can now also make use of the ProjectNameLockManager in order to prevent (re)creation of the same project while it is being deleted. [1] http://jgroups.org/manual/#LockService Change-Id: Idf52850e02adf823a54537b975631c3c3e4737d2
Gerrit is a code review and project management tool for Git based projects.
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.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
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.
The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit && bazel build release
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>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 7 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-centos7[:version]
To run a Ubuntu 15.04 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-ubuntu15.04[:version]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.