Merge "Merge branch 'stable-2.10' into stable-2.11" into stable-2.11

This commit is contained in:
David Pursehouse
2015-03-25 20:27:02 +00:00
committed by Gerrit Code Review
12 changed files with 202 additions and 222 deletions

View File

@@ -720,14 +720,24 @@ See also link:cmd-flush-caches.html[gerrit flush-caches].
==== [[cache_options]]Cache Options ==== [[cache_options]]Cache Options
[[cache.diff_intraline.maxIdleWorkers]]cache.diff_intraline.maxIdleWorkers:: [[cache.diff.timeout]]cache.diff.timeout::
+ +
Number of idle worker threads to maintain for the intraline difference Maximum number of milliseconds to wait for diff data before giving up and
computations. There is no upper bound on how many concurrent requests falling back on a simpler diff algorithm that will not be able to break down
can occur at once, if additional threads are started to handle a peak modified regions into smaller ones. This is a work around for an infinite loop
load, only this many will remain idle afterwards. bug in the default difference algorithm implementation.
+ +
Default is 1.5x number of available CPUs. Values should use common unit suffixes to express their setting:
+
* ms, milliseconds
* s, sec, second, seconds
* m, min, minute, minutes
* h, hr, hour, hours
+
If a unit suffix is not specified, `milliseconds` is assumed.
+
Default is 5 seconds.
[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout:: [[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
+ +

View File

@@ -63,7 +63,7 @@ import com.google.gerrit.server.index.IndexModule.IndexType;
import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier; import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier;
import com.google.gerrit.server.mail.SmtpEmailSender; import com.google.gerrit.server.mail.SmtpEmailSender;
import com.google.gerrit.server.mime.MimeUtil2Module; import com.google.gerrit.server.mime.MimeUtil2Module;
import com.google.gerrit.server.patch.IntraLineWorkerPool; import com.google.gerrit.server.patch.DiffExecutorModule;
import com.google.gerrit.server.plugins.PluginGuiceEnvironment; import com.google.gerrit.server.plugins.PluginGuiceEnvironment;
import com.google.gerrit.server.plugins.PluginRestApiModule; import com.google.gerrit.server.plugins.PluginRestApiModule;
import com.google.gerrit.server.schema.DataSourceProvider; import com.google.gerrit.server.schema.DataSourceProvider;
@@ -320,7 +320,7 @@ public class Daemon extends SiteProgram {
modules.add(new WorkQueue.Module()); modules.add(new WorkQueue.Module());
modules.add(new ChangeHookRunner.Module()); modules.add(new ChangeHookRunner.Module());
modules.add(new ReceiveCommitsExecutorModule()); modules.add(new ReceiveCommitsExecutorModule());
modules.add(new IntraLineWorkerPool.Module()); modules.add(new DiffExecutorModule());
modules.add(new MimeUtil2Module()); modules.add(new MimeUtil2Module());
modules.add(cfgInjector.getInstance(GerritGlobalModule.class)); modules.add(cfgInjector.getInstance(GerritGlobalModule.class));
modules.add(new InternalAccountDirectory.Module()); modules.add(new InternalAccountDirectory.Module());

View File

@@ -47,6 +47,7 @@ import com.google.gerrit.server.git.TagCache;
import com.google.gerrit.server.group.GroupModule; import com.google.gerrit.server.group.GroupModule;
import com.google.gerrit.server.mail.ReplacePatchSetSender; import com.google.gerrit.server.mail.ReplacePatchSetSender;
import com.google.gerrit.server.notedb.NoteDbModule; import com.google.gerrit.server.notedb.NoteDbModule;
import com.google.gerrit.server.patch.DiffExecutorModule;
import com.google.gerrit.server.patch.PatchListCacheImpl; import com.google.gerrit.server.patch.PatchListCacheImpl;
import com.google.gerrit.server.project.ChangeControl; import com.google.gerrit.server.project.ChangeControl;
import com.google.gerrit.server.project.CommentLinkInfo; import com.google.gerrit.server.project.CommentLinkInfo;
@@ -84,6 +85,7 @@ public class BatchProgramModule extends FactoryModule {
@Override @Override
protected void configure() { protected void configure() {
install(reviewDbModule); install(reviewDbModule);
install(new DiffExecutorModule());
install(PatchListCacheImpl.module()); install(PatchListCacheImpl.module());
// Plugins are not loaded and we're just running through each change // Plugins are not loaded and we're just running through each change
// once, so don't worry about cache removal. // once, so don't worry about cache removal.

View File

@@ -0,0 +1,31 @@
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.patch;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import com.google.inject.BindingAnnotation;
import java.lang.annotation.Retention;
import java.util.concurrent.ExecutorService;
/**
* Marker on {@link ExecutorService} used by
* {@link IntraLineLoader} and {@link PatchListLoader}.
*/
@Retention(RUNTIME)
@BindingAnnotation
public @interface DiffExecutor {
}

View File

@@ -0,0 +1,39 @@
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.patch;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** Module providing the {@link DiffExecutor}. */
public class DiffExecutorModule extends AbstractModule {
@Override
protected void configure() {
}
@Provides
@Singleton
@DiffExecutor
public ExecutorService createDiffExecutor() {
return Executors.newCachedThreadPool(new ThreadFactoryBuilder()
.setNameFormat("Diff-%d").setDaemon(true).build());
}
}

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.server.patch; package com.google.gerrit.server.patch;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.gerrit.server.config.ConfigUtil; import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig; import com.google.gerrit.server.config.GerritServerConfig;
@@ -29,7 +30,12 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
class IntraLineLoader extends CacheLoader<IntraLineDiffKey, IntraLineDiff> { class IntraLineLoader extends CacheLoader<IntraLineDiffKey, IntraLineDiff> {
@@ -41,12 +47,13 @@ class IntraLineLoader extends CacheLoader<IntraLineDiffKey, IntraLineDiff> {
private static final Pattern CONTROL_BLOCK_START_RE = Pattern private static final Pattern CONTROL_BLOCK_START_RE = Pattern
.compile("[{:][ \\t]*$"); .compile("[{:][ \\t]*$");
private final IntraLineWorkerPool workerPool; private final ExecutorService diffExecutor;
private final long timeoutMillis; private final long timeoutMillis;
@Inject @Inject
IntraLineLoader(IntraLineWorkerPool pool, @GerritServerConfig Config cfg) { IntraLineLoader(@DiffExecutor ExecutorService diffExecutor,
workerPool = pool; @GerritServerConfig Config cfg) {
this.diffExecutor = diffExecutor;
timeoutMillis = timeoutMillis =
ConfigUtil.getTimeUnit(cfg, "cache", PatchListCacheImpl.INTRA_NAME, ConfigUtil.getTimeUnit(cfg, "cache", PatchListCacheImpl.INTRA_NAME,
"timeout", TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS), "timeout", TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS),
@@ -54,27 +61,30 @@ class IntraLineLoader extends CacheLoader<IntraLineDiffKey, IntraLineDiff> {
} }
@Override @Override
public IntraLineDiff load(IntraLineDiffKey key) throws Exception { public IntraLineDiff load(final IntraLineDiffKey key) throws Exception {
IntraLineWorkerPool.Worker w = workerPool.acquire(); Future<IntraLineDiff> result = diffExecutor.submit(new Callable<IntraLineDiff>() {
IntraLineWorkerPool.Worker.Result r = w.computeWithTimeout(key, timeoutMillis); @Override
public IntraLineDiff call() throws Exception {
if (r == IntraLineWorkerPool.Worker.Result.TIMEOUT) { return IntraLineLoader.compute(key);
// Don't keep this thread. We have to murder it unsafely, which
// means its unable to be reused in the future. Return back a
// null result, indicating the cache cannot load this key.
//
return new IntraLineDiff(IntraLineDiff.Status.TIMEOUT);
} }
workerPool.release(w); });
try {
if (r.error != null) { return result.get(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException | TimeoutException e) {
log.warn(timeoutMillis + " ms timeout reached for IntraLineDiff"
+ " in project " + key.getProject().get()
+ " on commit " + key.getCommit().name()
+ " for path " + key.getPath()
+ " comparing " + key.getBlobA().name()
+ ".." + key.getBlobB().name());
result.cancel(true);
return new IntraLineDiff(IntraLineDiff.Status.TIMEOUT);
} catch (ExecutionException e) {
// If there was an error computing the result, carry it // If there was an error computing the result, carry it
// up to the caller so the cache knows this key is invalid. // up to the caller so the cache knows this key is invalid.
// Throwables.propagateIfInstanceOf(e.getCause(), Exception.class);
throw r.error; throw new Exception(e.getMessage(), e.getCause());
} }
return r.diff;
} }
static IntraLineDiff compute(IntraLineDiffKey key) throws Exception { static IntraLineDiff compute(IntraLineDiffKey key) throws Exception {

View File

@@ -1,182 +0,0 @@
// Copyright (C) 2009 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package com.google.gerrit.server.patch;
import static com.google.gerrit.server.patch.IntraLineLoader.log;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.jgit.lib.Config;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
@Singleton
public class IntraLineWorkerPool {
public static class Module extends AbstractModule {
@Override
protected void configure() {
bind(IntraLineWorkerPool.class);
}
}
private final BlockingQueue<Worker> workerPool;
@Inject
public IntraLineWorkerPool(@GerritServerConfig Config cfg) {
int workers = cfg.getInt(
"cache", PatchListCacheImpl.INTRA_NAME, "maxIdleWorkers",
Runtime.getRuntime().availableProcessors() * 3 / 2);
workerPool = new ArrayBlockingQueue<>(workers, true /* fair */);
}
Worker acquire() {
Worker w = workerPool.poll();
if (w == null) {
// If no worker is immediately available, start a new one.
// Maximum parallelism is controlled by the web server.
w = new Worker();
w.start();
}
return w;
}
void release(Worker w) {
if (!workerPool.offer(w)) {
// If the idle worker pool is full, terminate the worker.
w.shutdownGracefully();
}
}
static class Worker extends Thread {
private static final AtomicInteger count = new AtomicInteger(1);
private final ArrayBlockingQueue<Input> input;
private final ArrayBlockingQueue<Result> result;
Worker() {
input = new ArrayBlockingQueue<>(1);
result = new ArrayBlockingQueue<>(1);
setName("IntraLineDiff-" + count.getAndIncrement());
setDaemon(true);
}
Result computeWithTimeout(IntraLineDiffKey key, long timeoutMillis)
throws Exception {
if (!input.offer(new Input(key))) {
log.error("Cannot enqueue task to thread " + getName());
return Result.TIMEOUT;
}
Result r = result.poll(timeoutMillis, TimeUnit.MILLISECONDS);
if (r != null) {
return r;
} else {
log.warn(timeoutMillis + " ms timeout reached for IntraLineDiff"
+ " in project " + key.getProject().get()
+ " on commit " + key.getCommit().name()
+ " for path " + key.getPath()
+ " comparing " + key.getBlobA().name()
+ ".." + key.getBlobB().name()
+ ". Killing " + getName());
forcefullyKillThreadInAnUglyWay();
return Result.TIMEOUT;
}
}
@SuppressWarnings("deprecation")
private void forcefullyKillThreadInAnUglyWay() {
try {
stop();
} catch (Throwable error) {
// Ignore any reason the thread won't stop.
log.error("Cannot stop runaway thread " + getName(), error);
}
}
private void shutdownGracefully() {
if (!input.offer(Input.END_THREAD)) {
log.error("Cannot gracefully stop thread " + getName());
}
}
@Override
public void run() {
try {
for (;;) {
Input in;
try {
in = input.take();
} catch (InterruptedException e) {
log.error("Unexpected interrupt on " + getName());
continue;
}
if (in == Input.END_THREAD) {
return;
}
Result r;
try {
r = new Result(IntraLineLoader.compute(in.key));
} catch (Exception error) {
r = new Result(error);
}
if (!result.offer(r)) {
log.error("Cannot return result from " + getName());
}
}
} catch (ThreadDeath iHaveBeenShot) {
// Handle thread death by gracefully returning to the caller,
// allowing the thread to be destroyed.
}
}
private static class Input {
static final Input END_THREAD = new Input(null);
final IntraLineDiffKey key;
Input(IntraLineDiffKey key) {
this.key = key;
}
}
static class Result {
static final Result TIMEOUT = new Result((IntraLineDiff) null);
final IntraLineDiff diff;
final Exception error;
Result(IntraLineDiff diff) {
this.diff = diff;
this.error = null;
}
Result(Exception error) {
this.diff = null;
this.error = error;
}
}
}
}

View File

@@ -35,7 +35,7 @@ import java.util.concurrent.ExecutionException;
/** Provides a cached list of {@link PatchListEntry}. */ /** Provides a cached list of {@link PatchListEntry}. */
@Singleton @Singleton
public class PatchListCacheImpl implements PatchListCache { public class PatchListCacheImpl implements PatchListCache {
private static final String FILE_NAME = "diff"; static final String FILE_NAME = "diff";
static final String INTRA_NAME = "diff_intraline"; static final String INTRA_NAME = "diff_intraline";
public static Module module() { public static Module module() {

View File

@@ -16,11 +16,13 @@
package com.google.gerrit.server.patch; package com.google.gerrit.server.patch;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheLoader; import com.google.common.cache.CacheLoader;
import com.google.common.collect.FluentIterable; import com.google.common.collect.FluentIterable;
import com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace; import com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace;
import com.google.gerrit.reviewdb.client.Patch; import com.google.gerrit.reviewdb.client.Patch;
import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig; import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.git.GitRepositoryManager; import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.git.MergeUtil; import com.google.gerrit.server.git.MergeUtil;
@@ -69,6 +71,12 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> { public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
static final Logger log = LoggerFactory.getLogger(PatchListLoader.class); static final Logger log = LoggerFactory.getLogger(PatchListLoader.class);
@@ -76,13 +84,22 @@ public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
private final GitRepositoryManager repoManager; private final GitRepositoryManager repoManager;
private final PatchListCache patchListCache; private final PatchListCache patchListCache;
private final ThreeWayMergeStrategy mergeStrategy; private final ThreeWayMergeStrategy mergeStrategy;
private final ExecutorService diffExecutor;
private final long timeoutMillis;
@Inject @Inject
PatchListLoader(GitRepositoryManager mgr, PatchListCache plc, PatchListLoader(GitRepositoryManager mgr,
@GerritServerConfig Config cfg) { PatchListCache plc,
@GerritServerConfig Config cfg,
@DiffExecutor ExecutorService de) {
repoManager = mgr; repoManager = mgr;
patchListCache = plc; patchListCache = plc;
mergeStrategy = MergeUtil.getMergeStrategy(cfg); mergeStrategy = MergeUtil.getMergeStrategy(cfg);
diffExecutor = de;
timeoutMillis =
ConfigUtil.getTimeUnit(cfg, "cache", PatchListCacheImpl.FILE_NAME,
"timeout", TimeUnit.MILLISECONDS.convert(5, TimeUnit.SECONDS),
TimeUnit.MILLISECONDS);
} }
@Override @Override
@@ -164,7 +181,7 @@ public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
DiffEntry diffEntry = diffEntries.get(i); DiffEntry diffEntry = diffEntries.get(i);
if (paths == null || paths.contains(diffEntry.getNewPath()) if (paths == null || paths.contains(diffEntry.getNewPath())
|| paths.contains(diffEntry.getOldPath())) { || paths.contains(diffEntry.getOldPath())) {
FileHeader fh = df.toFileHeader(diffEntry); FileHeader fh = toFileHeader(key, df, diffEntry);
entries.add(newEntry(aTree, fh)); entries.add(newEntry(aTree, fh));
} }
} }
@@ -175,6 +192,44 @@ public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
} }
} }
private FileHeader toFileHeader(PatchListKey key,
final DiffFormatter diffFormatter, final DiffEntry diffEntry)
throws IOException {
Future<FileHeader> result = diffExecutor.submit(new Callable<FileHeader>() {
@Override
public FileHeader call() throws IOException {
return diffFormatter.toFileHeader(diffEntry);
}
});
try {
return result.get(timeoutMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException | TimeoutException e) {
log.warn(timeoutMillis + " ms timeout reached for Diff loader"
+ " in project " + key.projectKey.get()
+ " on commit " + key.getNewId().name()
+ " on path " + diffEntry.getNewPath()
+ " comparing " + diffEntry.getOldId().name()
+ ".." + diffEntry.getNewId().name());
result.cancel(true);
return toFileHeaderWithoutMyersDiff(diffFormatter, diffEntry);
} catch (ExecutionException e) {
// If there was an error computing the result, carry it
// up to the caller so the cache knows this key is invalid.
Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
throw new IOException(e.getMessage(), e.getCause());
}
}
private FileHeader toFileHeaderWithoutMyersDiff(DiffFormatter diffFormatter,
DiffEntry diffEntry) throws IOException {
HistogramDiff histogramDiff = new HistogramDiff();
histogramDiff.setFallbackAlgorithm(null);
diffFormatter.setDiffAlgorithm(histogramDiff);
return diffFormatter.toFileHeader(diffEntry);
}
private PatchListEntry newCommitMessage(final RawTextComparator cmp, private PatchListEntry newCommitMessage(final RawTextComparator cmp,
final ObjectReader reader, final ObjectReader reader,
final RevCommit aCommit, final RevCommit bCommit) throws IOException { final RevCommit aCommit, final RevCommit bCommit) throws IOException {

View File

@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkState;
import static com.google.inject.Scopes.SINGLETON; import static com.google.inject.Scopes.SINGLETON;
import com.google.common.net.InetAddresses; import com.google.common.net.InetAddresses;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.gerrit.common.ChangeHooks; import com.google.gerrit.common.ChangeHooks;
import com.google.gerrit.common.DisabledChangeHooks; import com.google.gerrit.common.DisabledChangeHooks;
import com.google.gerrit.reviewdb.client.AuthType; import com.google.gerrit.reviewdb.client.AuthType;
@@ -48,6 +49,7 @@ import com.google.gerrit.server.index.ChangeSchemas;
import com.google.gerrit.server.index.IndexModule.IndexType; import com.google.gerrit.server.index.IndexModule.IndexType;
import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier; import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier;
import com.google.gerrit.server.mail.SmtpEmailSender; import com.google.gerrit.server.mail.SmtpEmailSender;
import com.google.gerrit.server.patch.DiffExecutor;
import com.google.gerrit.server.schema.DataSourceType; import com.google.gerrit.server.schema.DataSourceType;
import com.google.gerrit.server.schema.SchemaCreator; import com.google.gerrit.server.schema.SchemaCreator;
import com.google.gerrit.server.securestore.DefaultSecureStore; import com.google.gerrit.server.securestore.DefaultSecureStore;
@@ -74,6 +76,7 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.util.concurrent.ExecutorService;
public class InMemoryModule extends FactoryModule { public class InMemoryModule extends FactoryModule {
public static Config newDefaultConfig() { public static Config newDefaultConfig() {
@@ -160,6 +163,18 @@ public class InMemoryModule extends FactoryModule {
return CanonicalWebUrlProvider.class; return CanonicalWebUrlProvider.class;
} }
}); });
//Replacement of DiffExecutorModule to not use thread pool in the tests
install(new AbstractModule() {
@Override
protected void configure() {
}
@Provides
@Singleton
@DiffExecutor
public ExecutorService createDiffExecutor() {
return MoreExecutors.newDirectExecutorService();
}
});
install(new DefaultCacheFactory.Module()); install(new DefaultCacheFactory.Module());
install(new SmtpEmailSender.Module()); install(new SmtpEmailSender.Module());
install(new SignedTokenEmailTokenVerifier.Module()); install(new SignedTokenEmailTokenVerifier.Module());

View File

@@ -47,7 +47,7 @@ import com.google.gerrit.server.index.IndexModule;
import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier; import com.google.gerrit.server.mail.SignedTokenEmailTokenVerifier;
import com.google.gerrit.server.mail.SmtpEmailSender; import com.google.gerrit.server.mail.SmtpEmailSender;
import com.google.gerrit.server.mime.MimeUtil2Module; import com.google.gerrit.server.mime.MimeUtil2Module;
import com.google.gerrit.server.patch.IntraLineWorkerPool; import com.google.gerrit.server.patch.DiffExecutorModule;
import com.google.gerrit.server.plugins.PluginGuiceEnvironment; import com.google.gerrit.server.plugins.PluginGuiceEnvironment;
import com.google.gerrit.server.plugins.PluginRestApiModule; import com.google.gerrit.server.plugins.PluginRestApiModule;
import com.google.gerrit.server.schema.DataSourceModule; import com.google.gerrit.server.schema.DataSourceModule;
@@ -286,7 +286,7 @@ public class WebAppInitializer extends GuiceServletContextListener
modules.add(new WorkQueue.Module()); modules.add(new WorkQueue.Module());
modules.add(new ChangeHookRunner.Module()); modules.add(new ChangeHookRunner.Module());
modules.add(new ReceiveCommitsExecutorModule()); modules.add(new ReceiveCommitsExecutorModule());
modules.add(new IntraLineWorkerPool.Module()); modules.add(new DiffExecutorModule());
modules.add(new MimeUtil2Module()); modules.add(new MimeUtil2Module());
modules.add(cfgInjector.getInstance(GerritGlobalModule.class)); modules.add(cfgInjector.getInstance(GerritGlobalModule.class));
modules.add(new InternalAccountDirectory.Module()); modules.add(new InternalAccountDirectory.Module());

View File

@@ -1,13 +1,13 @@
include_defs('//lib/maven.defs') include_defs('//lib/maven.defs')
REPO = GERRIT # Leave here even if set to MAVEN_CENTRAL. REPO = GERRIT # Leave here even if set to MAVEN_CENTRAL.
VERS = '3.6.2.201501210735-r.40-g23ad3a3' VERS = '3.7.0.201502260915-r.58-g65c379e'
maven_jar( maven_jar(
name = 'jgit', name = 'jgit',
id = 'org.eclipse.jgit:org.eclipse.jgit:' + VERS, id = 'org.eclipse.jgit:org.eclipse.jgit:' + VERS,
bin_sha1 = '849c10fec9a9af15f57651b99a5cf6de6bd3077c', bin_sha1 = '8fc9620ec499169facad3355f7417eb6a8aff511',
src_sha1 = '6fa857df4b73bf2fa222d3ad272e99e3c929453f', src_sha1 = '40bd9ae8af8e0b03eb4e43f44f5feda8b7325221',
license = 'jgit', license = 'jgit',
repository = REPO, repository = REPO,
unsign = True, unsign = True,
@@ -22,7 +22,7 @@ maven_jar(
maven_jar( maven_jar(
name = 'jgit-servlet', name = 'jgit-servlet',
id = 'org.eclipse.jgit:org.eclipse.jgit.http.server:' + VERS, id = 'org.eclipse.jgit:org.eclipse.jgit.http.server:' + VERS,
sha1 = 'f4a2252fac9258479394a3be3318f88fc8a538e8', sha1 = 'cecc2b9c0b94455348c3a0c63eb83f72cc595757',
license = 'jgit', license = 'jgit',
repository = REPO, repository = REPO,
deps = [':jgit'], deps = [':jgit'],
@@ -36,7 +36,7 @@ maven_jar(
maven_jar( maven_jar(
name = 'jgit-archive', name = 'jgit-archive',
id = 'org.eclipse.jgit:org.eclipse.jgit.archive:' + VERS, id = 'org.eclipse.jgit:org.eclipse.jgit.archive:' + VERS,
sha1 = 'bb1cf790a4ca6760f99b1d86ad5d25857bf69dc2', sha1 = '7ccc7c78bf47566045ea7a3c08508ba18e4684ca',
license = 'jgit', license = 'jgit',
repository = REPO, repository = REPO,
deps = [':jgit', deps = [':jgit',
@@ -53,7 +53,7 @@ maven_jar(
maven_jar( maven_jar(
name = 'junit', name = 'junit',
id = 'org.eclipse.jgit:org.eclipse.jgit.junit:' + VERS, id = 'org.eclipse.jgit:org.eclipse.jgit.junit:' + VERS,
sha1 = '9b9f2da56aacde9e58f905becc4780b4d64ee79e', sha1 = '87d64d722447dc3971ace30d2a72593c72a4d05f',
license = 'DO_NOT_DISTRIBUTE', license = 'DO_NOT_DISTRIBUTE',
repository = REPO, repository = REPO,
unsign = True, unsign = True,