Merge branch 'stable-2.8'

* stable-2.8:
  fixed minor spelling and capitalization mistakes
  Handle RepositoryNotFoundException when running reindex

Change-Id: Ifa7fbfb381d5e9dd5a5840c9ec3f16f1ea6d7142
This commit is contained in:
David Pursehouse
2013-11-27 16:11:54 +09:00
2 changed files with 12 additions and 6 deletions

View File

@@ -587,7 +587,7 @@ that change updates are not communicated between Gerrit servers. Hence
this cache should be disabled in an multi-master/multi-slave setup.
+
The cache should be flushed whenever the database changes table is modified
outside of gerrit.
outside of Gerrit.
cache `"diff"`::
+
@@ -786,7 +786,7 @@ By default 500.
How often in seconds the web interface should poll for updates to the
currently open change. The poller relies on the client's browser
cache to use If-Modified-Since and respect `304 Not Modified` HTTP
reponses. This allows for fast polls, often under 8 milliseconds.
responses. This allows for fast polls, often under 8 milliseconds.
+
With a configured 30 second delay a server with 4900 active users will
typically need to dedicate 1 CPU to the update check. 4900 users
@@ -959,7 +959,7 @@ configuration:
+
Used on Gerrit slave installations. If set to true the Gerrit JVM is
called with the '--slave' switch, enabling slave mode. If no value is
set (or any other value), gerrit defaults to master mode.
set (or any other value), Gerrit defaults to master mode.
[[container.user]]container.user::
+
@@ -2358,7 +2358,7 @@ in the database are ignored.
[[rules.enable]]rules.enable::
+
If true, Gerrit will load and excute 'rules.pl' files in each
If true, Gerrit will load and execute 'rules.pl' files in each
project's refs/meta/config branch, if present. When set to false,
only the default internal rules will be used.
+

View File

@@ -40,6 +40,7 @@ import com.google.inject.Provider;
import org.eclipse.jgit.diff.DiffEntry;
import org.eclipse.jgit.diff.DiffFormatter;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
@@ -203,8 +204,9 @@ public class ChangeBatchIndexer {
@Override
public Void call() throws Exception {
Multimap<ObjectId, ChangeData> byId = ArrayListMultimap.create();
Repository repo = repoManager.openRepository(project);
Repository repo = null;
try {
repo = repoManager.openRepository(project);
Map<String, Ref> refs = repo.getRefDatabase().getRefs(ALL);
for (Change c : db.get().changes().byProject(project)) {
Ref r = refs.get(c.currentPatchSetId().toRefName());
@@ -214,8 +216,12 @@ public class ChangeBatchIndexer {
}
new ProjectIndexer(indexer, byId, repo, done, failed, verboseWriter)
.call();
} catch(RepositoryNotFoundException rnfe) {
log.error(rnfe.getMessage());
} finally {
if (repo != null) {
repo.close();
}
// TODO(dborowitz): Opening all repositories in a live server may be
// wasteful; see if we can determine which ones it is safe to close
// with RepositoryCache.close(repo).