kobo / groovyserv

Groovy's startup acceralator.
http://kobo.github.io/groovyserv/
Other
98 stars 10 forks source link

Errors from quick repeated runs #68

Closed rattboi closed 7 years ago

rattboi commented 8 years ago

We are attempting to use groovyserv to run a handful of healthchecks that are kicked off fairly regularly. Over time, groovyserver stops responding and must be bounced. Apparently there is some sort of leak.

I've created a small test script to demonstrate:

while :
do
  ./bin/groovyclient -e "def a = 10; a = a + 10"
done

I manually started groovyserver with -v to get more verbose logging.

Below are the exceptions we are seeing:

3384987 2016/05/03 16:50:45,390 [ERROR] (java.lang.ThreadGroup[name=system,maxpri=10]) (RequestWorker:166) Failed to send the exit status: 5
3384988 groovyx.groovyserv.exception.GServIOException: Failed to send exit status
3384989   at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
3384990   at groovyx.groovyserv.ClientConnection.sendExit(ClientConnection.groovy:110)
3384991   at groovyx.groovyserv.ClientConnection.sendExit(ClientConnection.groovy)
3384992   at groovyx.groovyserv.ClientConnection$sendExit$0.call(Unknown Source)
3384993   at groovyx.groovyserv.RequestWorker.closeSafely(RequestWorker.groovy:164)
3384994   at groovyx.groovyserv.RequestWorker.closeSafely(RequestWorker.groovy)
3384995   at java.lang.reflect.Method.invoke(Method.java:483)
3384996   at groovyx.groovyserv.RequestWorker.terminated(RequestWorker.groovy:175)
3384997   at java.util.concurrent.ThreadPoolExecutor.tryTerminate(ThreadPoolExecutor.java:706)
3384998   at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:1394)
3384999   at java.util.concurrent.ThreadPoolExecutor.finalize(ThreadPoolExecutor.java:1477)
3385000   at java.lang.System$2.invokeFinalize(System.java:1267)
3385001   at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
3385002   at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
3385003   at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)
3385004 Caused by: java.net.SocketException: Socket closed
3385005   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
3385006   at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
3385007   at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
3385008   at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
3385009   at java.lang.reflect.Method.invoke(Method.java:483)
3385010   at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
3385011   at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
3385012   at groovyx.groovyserv.ClientConnection$_sendExit_closure1.doCall(ClientConnection.groovy:106)
3385013   at java.lang.reflect.Method.invoke(Method.java:483)
3385014   at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
3385015   at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
3385016   at groovy.lang.Closure.call(Closure.java:426)
3385017   at groovy.lang.Closure.call(Closure.java:442)
3385018   at groovyx.groovyserv.ClientConnection.sendExit(ClientConnection.groovy:103)
3385019   ... 18 more
3385020   (sanitized)
3385021 2016/05/03 16:50:45,392 [DEBUG] (java.lang.ThreadGroup[name=system,maxpri=10]) (ClientConnection:156) PipedOutputStream is closed
3385022 2016/05/03 16:50:45,392 [DEBUG] (java.lang.ThreadGroup[name=system,maxpri=10]) (ClientConnection:126) PipedInputStream is closed
3385023 2016/05/03 16:50:45,393 [ERROR] (java.lang.ThreadGroup[name=system,maxpri=10]) (IOUtils:44) Failed to close
3385024 java.net.SocketException: Socket closed
3385025   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:116)
3385026   at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
3385027   at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
3385028   at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
3385029   at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
3385030   at java_io_Closeable$close$0.call(Unknown Source)
3385031   at java_io_Closeable$close$0.call(Unknown Source)
3385032   at groovyx.groovyserv.utils.IOUtils.close(IOUtils.groovy:42)
3385033   at groovyx.groovyserv.utils.IOUtils$close$1.call(Unknown Source)
3385034   at groovyx.groovyserv.ClientConnection.close(ClientConnection.groovy:132)
3385035   at java_io_Closeable$close.call(Unknown Source)
3385036   at java_io_Closeable$close$0.call(Unknown Source)
3385037   at groovyx.groovyserv.utils.IOUtils.close(IOUtils.groovy:42)
3385038   at groovyx.groovyserv.utils.IOUtils$close$1.call(Unknown Source)
3385039   at groovyx.groovyserv.RequestWorker.closeSafely(RequestWorker.groovy:168)
3385040   at groovyx.groovyserv.RequestWorker.closeSafely(RequestWorker.groovy)
3385041   at java.lang.reflect.Method.invoke(Method.java:483)
3385042   at groovyx.groovyserv.RequestWorker.terminated(RequestWorker.groovy:175)
3385043   at java.util.concurrent.ThreadPoolExecutor.tryTerminate(ThreadPoolExecutor.java:706)
3385044   at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:1394)
3385045   at java.util.concurrent.ThreadPoolExecutor.finalize(ThreadPoolExecutor.java:1477)
3385046   at java.lang.System$2.invokeFinalize(System.java:1267)
3385047   at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
3385048   at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
3385049   at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)
3385050   (sanitized)

We see these repeatedly, and over time, groovyserv becomes unresponsive and no longer executes new requests via groovyclient.

nobeans commented 8 years ago

Yes. The error often occurs. I think it's because the client can't receive a exit status from a server process like timing issue or something.

Can't you execute new requests via groovyclient from another console, though the errors occur? I could reproduce the errors with your test script perhaps. But I can execute new request from another console while the test script is running. Even after stop the script emitting many error logs, I can execute new request, too.

nobeans commented 7 years ago

If requires, reopen and add a comment.