On Wed, Mar 26, 2014 at 4:50 AM, Saša Živkov <
ziv...@gmail.com> wrote:
> On Wed, Mar 26, 2014 at 9:22 AM, 高志鹏 <
martincz...@gmail.com> wrote:
>>
>> Hi, mate.
>> When I upgrade gerrit version from 2.8.2 to 2.9-rc1 and restart it.
>> Tell me "Starting Gerrit Code Review: FAILED"
>> How can I fix it or downgrade to 2.8.2?
>>
>> Here is error log:
>> [2014-03-26 16:04:23,584] INFO
>> com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache
>> /home/gerrit2/review_site/cache
>> [2014-03-26 16:04:26,458] ERROR com.google.gerrit.pgm.Daemon : Unable to
>> start daemon
>> com.google.inject.CreationException: Guice creation errors:
>>
>> 1) Error injecting constructor, java.lang.IllegalArgumentException
>> at
>> com.google.gerrit.pgm.http.jetty.JettyServer.<init>(JettyServer.java:143)
>> at
>> com.google.gerrit.pgm.http.jetty.JettyModule.configure(JettyModule.java:29)
>> while locating com.google.gerrit.pgm.http.jetty.JettyServer
>>
>> 1 error
>> at
>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:448)
>> at
>> com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
>> at
>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
>> at
>> com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:230)
>> at com.google.gerrit.pgm.Daemon.createHttpdInjector(Daemon.java:434)
>> at com.google.gerrit.pgm.Daemon.initHttpd(Daemon.java:399)
>> at com.google.gerrit.pgm.Daemon.start(Daemon.java:285)
>> at com.google.gerrit.pgm.Daemon.run(Daemon.java:200)
>> at
>> com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:63)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at
>> com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
>> at
>> com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
>> at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
>> at Main.main(Main.java:25)
>> Caused by: java.lang.IllegalArgumentException
>> at
>> org.eclipse.jetty.util.BlockingArrayQueue.<init>(BlockingArrayQueue.java:133)
>
>
> Checking the Jetty source code shows that the IllegalArgumentException is
> thrown when
> the capacity is larger maxCapacity:
> public BlockingArrayQueue(int capacity, int growBy, int maxCapacity)
> {
> if (capacity > maxCapacity)
> throw new IllegalArgumentException();
> _elements = new Object[capacity];
> _growCapacity = growBy;
> _maxCapacity = maxCapacity;
> }
>
>
>>
>>
>>
>> at
>> com.google.gerrit.pgm.http.jetty.JettyServer.threadPool(JettyServer.java:328)
>
>
> From gerrit we pass the httpd.minThreads as the capacity and httpd.maxQueued
> as the maxCapacity.
> In your case httpd.minThreads is not defined so the default of 5 is used.
> Since your httpd.maxQueued is 0 you have exactly that error condition.
> So make sure that httpd.minThreads <= httpd.maxQueued.
>
> I am not sure if this is a bug in Gerrit... but if yes then it was
> introduced by 8e78797190ddb9e04f93190bae86fe3956f08b3d
> which is only contained in 2.9-* releases.
This is a bug in the 2.9 branch. Thank you for helping to identify it
before the release.
I uploaded
https://gerrit-review.googlesource.com/55561 to fix the bug.