Jetty Issue

115 views
Skip to first unread message

Anthony Russello

unread,
Dec 8, 2009, 11:08:17 PM12/8/09
to Repo and Gerrit Discussion
Hi,

I've configured Gerrit (v2.0.24.2), and it works great while I am
actively using it, but I am experiencing an issue that seems to be
with the mysl-connector-java plugin (my guess after doing some google
searches).

After 12+ hours of inactivity, if I try to connect to Gerrit I receive
an error message:

Internal Server Error

In the logs I get:

<snip>
2009-12-07 00:01:14.965:WARN:/:Error in allOpenNext
com.google.gwtorm.client.OrmException: fetch failure on changes
at com.google.gwtorm.schema.sql.SqlDialect.convertError
(SqlDialect.java:118)
...
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
The last packet successfully received from the server was 216,796,727
milliseconds ago. The last packet sent successfully to the server was
216,796,727 milliseconds ago. is longer than the server configured
value of 'wait_timeout'. You should consider either expiring and/or
testing connection validity before use in your application, increasing
the server configured values for client timeouts, or using the
Connector/J connection property 'autoReconnect=true' to avoid this
problem.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
...
at com.google.gwtorm.jdbc.JdbcAccess.queryList(JdbcAccess.java:133)
... 47 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:
92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:
65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3294)
... 54 more

To resolve it, I have to restart gerrit-jetty.sh on the server, then
it works without error until the next 12 hour period of inactivity.

Is anyone else experiencing the same issue? Can you provide any
pointers on how you resolved it?

We can't really just use a cron job to keep restarting Jetty, as our
team is global, and will be working off of this server instance almost
24 hours a day.

Thanks in advance,
Anthony

Edwin Cruz

unread,
Dec 8, 2009, 11:15:47 PM12/8/09
to repo-d...@googlegroups.com
We solved the problem adding autoReconnect flag in the connection string:

jetty/context/gerrit.xml

<Set name="driverClassName">com.mysql.jdbc.Driver</Set>
        <Set name="url">jdbc:mysql://localhost/reviews?autoReconnect=true&amp;characterEncoding=latin1&amp;user=reviews&amp;password=secret</Set>


hope that helps and regards!

--
Ing.  Edwin Cruz


Shawn Pearce

unread,
Dec 9, 2009, 9:01:37 AM12/9/09
to repo-d...@googlegroups.com
I solved it with MySQL by just removing the connection pool and
opening a new connection each time. Unlike PostgreSQL, MySQL opens
and closes connections fairly quickly so connection pooling is
slightly less important to get reasonable response times.

Anthony Russello

unread,
Dec 10, 2009, 12:43:53 AM12/10/09
to Repo and Gerrit Discussion
Hi Edwin,

Thanks for the tip, I just made that change, and will check it
tomorrow.

Temporarily, I had created a cron job on the server that pulled a
patch out of gerrit. This ran once every hour, and was a small patch.
That worked, but it's not a valid fix.

I will let you know if this works.

Thanks,
Anthony

On Dec 9, 12:15 pm, Edwin Cruz <sof...@gmail.com> wrote:
> We solved the problem adding autoReconnect flag in the connection string:
>
> jetty/context/gerrit.xml
>
> <Set name="driverClassName">com.mysql.jdbc.Driver</Set>
>         <Set
> name="url">jdbc:mysql://localhost/reviews?autoReconnect=true&amp;characterEncoding=latin1&amp;user=reviews&amp;password=secret</Set>
>
> hope that helps and regards!
>
> --
> Ing.  Edwin Cruz
>
> > To unsubscribe, email repo-discuss...@googlegroups.com<repo-discuss%2Bunsu...@googlegroups.com>
> > More info athttp://groups.google.com/group/repo-discuss?hl=en
>
>

Anthony Russello

unread,
Dec 10, 2009, 12:44:53 AM12/10/09
to Repo and Gerrit Discussion
Hi Shawn,

Can you explain how you accomplished this?

Thanks,
Anthony

On Dec 9, 10:01 pm, Shawn Pearce <s...@google.com> wrote:
> I solved it with MySQL by just removing the connection pool and
> opening a new connection each time.  Unlike PostgreSQL, MySQL opens
> and closes connections fairly quickly so connection pooling is
> slightly less important to get reasonable response times.
>
> On Tue, Dec 8, 2009 at 20:15, Edwin Cruz <sof...@gmail.com> wrote:
> > We solved the problem adding autoReconnect flag in the connection string:
> > jetty/context/gerrit.xml
> > <Set name="driverClassName">com.mysql.jdbc.Driver</Set>
> >         <Set
> > name="url">jdbc:mysql://localhost/reviews?autoReconnect=true&amp;characterEncoding=latin1&amp;user=reviews&amp;password=secret</Set>
>
> > hope that helps and regards!
> > --
> > Ing.  Edwin Cruz
>
> > On Tue, Dec 8, 2009 at 10:08 PM, Anthony Russello <arusse...@gmail.com>
> >> More info athttp://groups.google.com/group/repo-discuss?hl=en
Reply all
Reply to author
Forward
0 new messages