Add a separate queue for non-interactive users

A new internal user group, "Non-Interactive Users" is added. members
of this group are not expected to perform interactive operations on
the gerrit web frontend.

However, sometimes such a user may need a separate thread pool in
order to prevent it from grabbing threads from the interactive users.

This change introduces a second thread pool, which separates
operations from the non-interactive users from the interactive ones.
This ensures that the interactive users can keep working when
resources are tight.

Change-Id: I16334dd84ec50e1a6ca894e635c8beea9bd42115
This commit is contained in:
Nico Sallembien
2010-05-18 16:40:10 -07:00
parent 8ef3b69f35
commit fc53f7fd7a
12 changed files with 224 additions and 37 deletions

View File

@@ -40,6 +40,7 @@ import com.google.gerrit.util.cli.CmdLineParser;
import com.google.gerrit.util.cli.OptionHandlerFactory;
import com.google.gerrit.util.cli.OptionHandlerUtil;
import com.google.inject.Key;
import com.google.inject.Scopes;
import com.google.inject.TypeLiteral;
import com.google.inject.assistedinject.FactoryProvider;
import com.google.inject.servlet.RequestScoped;
@@ -72,11 +73,9 @@ public class SshModule extends FactoryModule {
.toInstance(new DispatchCommandProvider("", Commands.CMD_ROOT));
bind(CommandFactoryProvider.class);
bind(CommandFactory.class).toProvider(CommandFactoryProvider.class);
bind(WorkQueue.Executor.class).annotatedWith(CommandExecutor.class)
.toProvider(CommandExecutorProvider.class).in(SINGLETON);
bind(WorkQueue.Executor.class).annotatedWith(StreamCommandExecutor.class)
.toProvider(StreamCommandExecutorProvider.class).in(SINGLETON);
bind(QueueProvider.class).to(CommandExecutorQueueProvider.class).in(SINGLETON);
bind(PublickeyAuthenticator.class).to(DatabasePubKeyAuth.class);
bind(PasswordAuthenticator.class).to(DatabasePasswordAuth.class);
@@ -107,6 +106,9 @@ public class SshModule extends FactoryModule {
bind(IdentifiedUser.class).toProvider(SshIdentifiedUserProvider.class).in(
SshScope.REQUEST);
bind(WorkQueue.Executor.class).annotatedWith(CommandExecutor.class)
.toProvider(CommandExecutorProvider.class).in(SshScope.REQUEST);
install(new GerritRequestModule());
}