I am running a CFML web framework which I’ve migrated to Lucee 4.5 from
Railo 4. Just recently 2 VMs running Lucee both began locking up (website
unresponsive). One server runs Lucee 4.5.2, the other 4.5.3. The sites on
these servers are not under high load. Trying to restart Lucee after it
becomes unresponsive results in this error being dumped to console:
host# service lucee_ctl stop
- Shutting down Lucee: . . . . . . . . . . [FAIL]
- The Tomcat/Lucee process is not responding. Forcing shutdown…
- Forcing Lucee Shutdown: [DONE]
host# Jun 21, 2016 7:04:53 AM org.apache.catalina.startup.Catalina
stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Jun 21, 2016 7:04:53 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.(Socket.java:434)
at java.net.Socket.(Socket.java:211)
at
org.apache.catalina.startup.Catalina.stopServer(Catalina.java:450)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at
org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:400)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:487)
The stop command failed. Attempting to signal the process to stop through
OS signal.
In the logs I get a lot of these errors when stopping the server:
21-Jun-2016 07:06:12.859 WARNING
[-dev-04-vhost--confl1-startStop-2]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
web application [ROOT] appears to have started a thread named [Thread-9352]
but has failed to stop it. This is very likely to create a memory leak.
Stack trace of thread:
java.lang.Thread.sleep(Native Method)
lucee.commons.io.SystemUtil.sleep(SystemUtil.java:623)
lucee.runtime.cache.ram.RamCache$Controler.run(RamCache.java:166)
21-Jun-2016 07:06:12.882 WARNING [127.0.0.1-startStop-2]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
web application [ROOT] appears to have started a thread named [Thread-6]
but has failed to stop it. This is very likely to create a memory leak.
Stack trace of thread:
java.lang.Thread.sleep(Native Method)
lucee.commons.io.SystemUtil.sleep(SystemUtil.java:623)
lucee.runtime.engine.Controler.run(Controler.java:132)
21-Jun-2016 07:06:12.905 WARNING [-04-vhost--confl1-startStop-2]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
web application [ROOT] appears to have started a thread named [Thread-36]
but has failed to stop it. This is very likely to create a memory leak.
Stack trace of thread:
java.lang.Thread.sleep(Native Method)
lucee.commons.io.SystemUtil.sleep(SystemUtil.java:623)
lucee.runtime.cache.ram.RamCache$Controler.run(RamCache.java:166)
21-Jun-2016 07:06:12.939 WARNING -04-vhost--confl1-startStop-2]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
web application [ROOT] appears to have started a thread named [Thread-28]
but has failed to stop it. This is very likely to create a memory leak.
Stack trace of thread:
java.lang.Thread.sleep(Native Method)
lucee.commons.io.SystemUtil.sleep(SystemUtil.java:623)
lucee.runtime.cache.ram.RamCache$Controler.run(RamCache.java:166)
and these:
“ERROR”,“Thread-1382897”,“06/05/2016”,“15:22:49”,“”,";org.apache.tomcat.util.threads.TaskThread.stop0(java.lang.Object);java.lang.NoSuchMethodException:
org.apache.tomcat.util.threads.TaskThread.stop0(java.lang.Object)
at java.lang.Class.getMethod(Class.java:1786)
at lucee.commons.io.StopThread.run(SystemUtil.java:1085)
and these:
“ERROR”,“Thread-1406273”,“06/06/2016”,“11:19:49”,“”,"Thread.stop(Throwable)
is not supported by this JVM and failed with
UnsupportedOperationException;java.lang.Throwable;java.lang.Throwable
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1782)
…
The module where the last error is thrown can be any long-running task but
not sure if this error is the cause of lockups or a side-effect of timeouts
or the service restart.
Lucee was installed via installer on website so is a stock configuration
(OpenJDK 1.8 / Tomcat 8.0 / Apache 2.4 using AJP). I’ve tried different
settings for min and max heap sizes in setenv.sh but I’ve seen no
noticeable increase or reduction in these lockups (which happen at least
once a day now but otherwise seem random).