Code of CFCs in componentPaths isn't flushed by PagePoolClear() or SystemCacheClear()
Description
Environment
Ubuntu 16.04
Apache 2.4
Attachments
- 09 Aug 2018, 08:09 am
Activity
Leon Miller-Out 21 May 2019 at 13:36
Thanks, @Michael Offner ! I’ve verified that this change fixes the bug.
There may be a related regression in version 5.3.3.41. When I run the test twice, immediately after updating to 5.3.3.41, I get this error:
Lucee 5.3.3.41-SNAPSHOT Error (java.lang.NoClassDefFoundError)
Message org/lucee/extension/cache/eh/util/CacheUtil
Stacktrace The Error Occurred in
/var/www/csubs_release/htdocs_client/temp/ldev1935/index.cfm: line 3
1: <cfscript>
2: PagePoolClear();
3: SystemCacheClear();
4:
5: WriteOutput(new number().get());
Java Stacktrace lucee.runtime.exp.NativeException: org/lucee/extension/cache/eh/util/CacheUtil
at org.lucee.extension.cache.CacheSupport.remove(CacheSupport.java:184)
at lucee.runtime.cache.tag.timespan.TimespanCacheHandler.clear(TimespanCacheHandler.java:113)
at lucee.runtime.cache.tag.CacheHandlerCollectionImpl.clear(CacheHandlerCollectionImpl.java:140)
at lucee.runtime.functions.system.SystemCacheClear.queryCache(SystemCacheClear.java:82)
at lucee.runtime.functions.system.SystemCacheClear.call(SystemCacheClear.java:52)
at lucee.runtime.functions.system.SystemCacheClear.call(SystemCacheClear.java:43)
at temp.ldev1935.index_cfm$cf.call(/temp/ldev1935/index.cfm:3)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:216)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:42)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2409)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2399)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2374)
at lucee.runtime.engine.Request.exe(Request.java:43)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1106)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1052)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:764)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:344)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:207)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:801)
at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71)
at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54)
at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:41)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2464)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/lucee/extension/cache/eh/util/CacheUtil
... 58 more
Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.lucee.extension.cache.eh.util.CacheUtil' because the bundle wiring for ehcache.extension is no longer valid.
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1604)
at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 58 more
Timestamp 5/21/19 9:29:18 AM EDT
However, if I then restart Lucee. This error goes away. I’m not sure how to handle this, if at all. In my opinion, having to restart once after this upgrade is worth having a PagePoolClear() that really works.
Michael Offner 20 May 2019 at 15:02
Michael Offner 20 August 2018 at 14:34
i do not assume that this is the case here, i simply want to point out this piece of fact.
Zac Spitzer 9 August 2018 at 10:36
@Leon Miller-Out I think that might be a useful data point...
I just attached a copy of the test case as a zip file so it's easier to reproduce
Leon Miller-Out 8 August 2018 at 14:47
@Michael Offner I don't believe I have any lingering references to number.cfc. I've also tried with a separate flush.cfm script that just flushes the caches and that doesn't work either.
@Zac Spitzer restarting the web context might be an workaround, but only if it doesn't result in many seconds of downtime.
Another symptom of the root problem may be that number.cfc isn't in the "page pool", as evidenced by dumping out PagePoolList() and seeing that it doesn't show up in that output. I'm not sure if that's a useful data point.
Details
Details
Assignee
Reporter
Priority
Labels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Code of CFCs in componentPaths isn't flushed by PagePoolClear() or SystemCacheClear(). This makes using the highly-performant "Inspect Templates: Never" setting impractical for many applications. Instead, we must use "Inspect Templates: Once".
To reproduce:
1. Set Inspect Templates to "Never" in Lucee Web Admin.
2. Create the following files:
Application.cfc:
component { this.componentPaths = [ExpandPath('.') & '/objects']; }
objects/number.cfc:
component { public string function get() { return 4; } }
index.cfm
<cfscript> PagePoolClear(); SystemCacheClear(); WriteOutput(new number().get()); PagePoolClear(); SystemCacheClear(); </cfscript>
3. Visit index.cfm. See that it outputs "4".
4. Change the number returned by the get() method in number.cfc to 5.
5. Reload index.cfm. See that it still outputs "4". It should output 5.
6. Reload as many times as you want. Lucee will not pick up the change to number.cfc, even though PagePoolClear() and SystemCacheClear() are being called.
This problem only seems to affect CFCs in the application's componentPath array. A CFC in the same folder as index.cfm will not exhibit the problem.