gerrit/gerrit-pgm
Dave Borowitz 234734a5f5 Run ReceiveCommits in a shared thread pool
Since the work ReceiveCommits may take a long, potentially unbounded
amount of time, we would like to have it run in the background so it
can be monitored for timeouts and cancelled, and have stalls reported
to the user from the main thread.

Wraps ReceiveCommits in a new PreReceiveHook, AsyncReceiveCommits,
that runs its delegated ReceiveCommits in a WorkQueue.Executor.

The default implementation sizes the thread pool to the number of
available processors, under the assumption that most database and pack
operations are essentially CPU-bound. This is after reading the pack
from the wire, indexing it, and storing it locally, so there is no I/O
to the client involved, and available CPUs is a pretty good estimate.
Since it may not be in some cases, for example if threads block on
slow database I/O, the pool size is configurable.

Change-Id: I5769944b49ead4224a1855ba72ee359de26e7bf8
2012-03-09 16:09:24 -08:00
..
.settings Updating eclipse settings for 3.7 and m2e 1.0 2011-07-29 08:29:51 -07:00
src Run ReceiveCommits in a shared thread pool 2012-03-09 16:09:24 -08:00
.gitignore Add entries to .gitignore for m2e settings/preference files 2011-12-12 16:56:53 -06:00
pom.xml Update poms to Gerrit 2.3-SNAPSHOT 2012-02-22 17:19:32 -07:00