ipggi
Newbie
Joined: 07/28/08
Posts: 9 |
A timeout occurred while attempting to lock
07/28/08 7:45 PM
I have been enjoying learning and using ColdBox to no end, to me it is the best CFML framework and toolbox out there, at least in my development enviroment. I have been even combining it with Transfer ORM to make programming for it even easier.
But I have been having many performance problems with the combination. Initially I was using CB 2.52 and it's performance combined with Transfer on a HostMySite shared account was totally unacceptable. There were numerous timeouts and page abortions.
I noticed there were some new cache performance improvements with CB 2.60 so I upgraded. There were still random bugs occurring, specifically an odd javalangnullpointer exception error. But again I have a feeling they were related to Transfer, so I was thinking of removing it and replacing it with my own SQL.
This morning though my site is completely dead as soon as any page runs thanks to the Application.cfc pre-loading ColdBox. Essentially it times out before loading itself? It is getting to the point where I will have to revert back to the previous non-CB version of the site, as ColdBox seems to be too resource intensive for my shared hosting account.
You can see the problem here at http://www.civbox.org/, the timeouts occur even when I use any of the troubleshooting url actions such as the fwreinit, debugmode etc
A timeout occurred while attempting to lock DC5CF9189FA37B5CEE3AB11FD50F9E23. The error occurred in C:\x\x\coldbox\system\coldbox.cfc: line 66 Called from C:\x\x\Application.cfc: line 69 Called from C:\x\x\coldbox\system\coldbox.cfc: line 66 Called from C:\x\x\Application.cfc: line 69
64 : <!--- Initialize the Controller If Needed---> 65 : <cfif not structkeyExists(application,"cbController") or not application.cbController.getColdboxInitiated() or isfwReinit()> 66 : <cflock type="exclusive" name="#getAppHash()#" timeout="#getLockTimeout()#" throwontimeout="true"> 67 : <cfif not structkeyExists(application,"cbController") or not application.cbController.getColdboxInitiated() or isfwReinit()> 68 : <cfset loadColdBox()>
Regards Ben
|
|
Link | Top | Bottom
|
lmajano
Veteran Master
Joined: 01/29/05
Posts: 1142 |
RE: A timeout occurred while attempting to lock
07/28/08 11:26 PM
What you are experimenting is a known java bug in JDK 6.X. This is called the java class loading issue. Your provider must be running ColdFusion 8 under this JDK. You will see incredible performance hits to startup any framework application because of the amount of cfc's it uses. The solution as of now is to revert back to JDK 1.5 until Sun comes out with a patch for this bug.
You can see a similar thread here:
http://forums.coldboxframework.com/index.cfm?event=ehMessages.dspMessages&threadid=C276C330-FF6E-E829-9A5C1B871819D5E2
Luis Luis Majano
|
|
Link | Top | Bottom
|
sanaullah73
Veteran Master
Joined: 08/18/06
Posts: 405 |
RE: A timeout occurred while attempting to lock
07/29/08 5:23 AM
Hi,
As Luis said its mostly related to Java Class loading issue. Also I would suggest to use Application.cfc with inheritance. So change your Application.cfc.
Please see the ApplicationTemplate sample of Application.cfc
<cfcomponent extends="coldbox.system.coldbox" output="false">
I am still looking into Application.cfc without inheritance which is sometime cause loading issue.
Please let us know the progress and we will help you ASAP.
Sana Sana
|
|
Link | Top | Bottom
|
ipggi
Newbie
Joined: 07/28/08
Posts: 9 |
RE: A timeout occurred while attempting to lock
07/29/08 5:54 PM
Hi, Sanaullah my Application.cfc already had inheritance. So unfortunately that was not the cause of the problem.
lmajano it seems you are correct and my helpful hosting provider has acknowledge this. Unfortunately they can not revert back to JDK 1.5 for any of their shared account or VPS hosting servers due to technical issues.
So the suggestion has been put to me that I migrate back to ColdFusion MX7. Either that or I'll just have to revert back to using the pre-framework pages. Then wait until an updated version of ColdFusion is released with a revised Java edition, which incorporates a fix to this bug.
|
|
Link | Top | Bottom
|
sanaullah73
Veteran Master
Joined: 08/18/06
Posts: 405 |
RE: A timeout occurred while attempting to lock
07/29/08 6:25 PM
Hi
couple of thing I am interested to know about
1: ColdSpring (Are you using ?) 2: Objects (how you are loading objects)
Would you post your coldbox.xml.cfm .
Coldbox (core code base ) does not load every objects so it has pretty fast load time. I think there are something else as well which cause time-out issue.
make sure you have proper production settings turned on in coldbox.xml.cfm when you deploy to live server.
please provide us more detail about your set-up.
Sana Sana
|
|
Link | Top | Bottom
|
ipggi
Newbie
Joined: 07/28/08
Posts: 9 |
RE: A timeout occurred while attempting to lock
07/29/08 6:56 PM
No I am not using CodeSpring. I don't know what else to tell you about the setup other then it's on a shared hosting provider with HostMySite. They are running ColdFusion 8.0.1 on Windows servers.
The content of the site itself has around 80 VIEWS, many are separated views designed for reuse; 3 PLUGINS with 12 functions; 3 MODELS with 13 functions; 3 LAYOUTS; 1 INTERCEPTOR; and 13 HANDLERS.
coldbox.xml.cfm
<?xml version= "1.0" encoding= "ISO-8859-1"?> <Config xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "http://www.coldboxframework.com/schema/config_2.6.0.xsd"> <Settings> <Setting name="AppName" value="CivBox Software"/> <Setting name="DebugMode" value="false" /> <Setting name="DebugPassword" value="xxxx"/> <Setting name="ReinitPassword" value="xxxx"/> <Setting name="EventName" value="event" /> <Setting name="EnableDumpVar" value="false" /> <Setting name="EnableColdfusionLogging" value="false" /> <Setting name="EnableColdboxLogging" value="false" /> <Setting name="ColdboxLogsLocation" value="logs" /> <Setting name="DefaultEvent" value="news"/> <Setting name="RequestStartHandler" value="main.onRequestStart"/> <Setting name="RequestEndHandler" value="main.onRequestEnd"/> <Setting name="ApplicationStartHandler" value="main.onAppInit"/> <Setting name="SessionStartHandler" value="main.onSessionStart"/> <Setting name="SessionEndHandler" value="main.onSessionEnd"/> <Setting name="ExceptionHandler" value="" /> <Setting name="onInvalidEvent" value="" /> <Setting name="CustomErrorTemplate" value="" /> <Setting name="OwnerEmail" value="xxxx@xxxx.com" /> <Setting name="EnableBugReports" value="true"/> <Setting name="UDFLibraryFile" value="" /> <Setting name="MessageboxStyleOverride" value="" /> <Setting name="HandlersIndexAutoReload" value="false" /> <Setting name="ConfigAutoReload" value="false" /> <Setting name="MyPluginsLocation" value="" /> <Setting name="ViewsExternalLocation" value=""/> <Setting name="HandlersExternalLocation" value="" /> <Setting name="HandlerCaching" value="true"/> <Setting name="EventCaching" value="true"/> <Setting name="IOCFramework" value="" /> <Setting name="IOCDefinitionFile" value="" /> <Setting name="IOCObjectCaching" value="false" /> <Setting name="RequestContextDecorator" value=""/> <Setting name="ProxyReturnCollection" value="false"/> <Setting name="FlashURLPersistScope" value="session"/> </Settings> <YourSettings> <Setting name="TransferSettings" value="{datasourceFile:'config/datasource.xml.cfm',transferFile:'config/transfer.xml.cfm',definitions:'config/definitions'}"/> <Setting name="SiteName" value="CivBox Software"/> <Setting name="Path.manuals" value="xxxx/manuals/"/> <Setting name="Path.files" value="xxxx/productstorage/"/> </YourSettings> <!--Optional,if blank it will use the CFMX administrator settings.--> <MailServerSettings> <MailServer></MailServer> <MailPort></MailPort> <MailUsername></MailUsername> <MailPassword></MailPassword> </MailServerSettings> <BugTracerReports/> <!--List url dev environments, this determines your dev/pro environment for the framework--> <DevEnvironments> <url>dev </url> </DevEnvironments> <WebServices /> <!--Declare Layouts for your application here--> <Layouts> <!--Declare the default layout, MANDATORY--> <DefaultLayout>Layout.Main.cfm </DefaultLayout> <Layout file="Layout.Clean.cfm" name="clean"> <View>bitmaptxt-app </View> <View>feeds </View> </Layout> <Layout file="Layout.ViewSource.cfm" name="viewsource"> <View>opensource-dspsource </View> </Layout> </Layouts> --> <i18N /> <Datasources /> <Interceptors> <!-- config file is relative to app root --> <Interceptor class="coldbox.system.interceptors.ses"> <Property name="configFile">config/routes.cfm </Property> </Interceptor> <Interceptor class="interceptors.securityInterceptor"> <Property name="securedEvents">service </Property> </Interceptor> </Interceptors> </Config>
main.cfc
<cffunction name="onAppInit" access="public" returntype="void" output="false">
<cfargument name="Event" type="coldbox.system.beans.requestContext">
<!--- ON Application Start Here --->
<!--- Create our Transfer Factory --->
<cfset var DSFile = "#getSetting("TransferSettings").datasourceFile#">
<cfset var TFile = getSetting("TransferSettings").transferFile>
<cfset var Definitions = "/" & getSetting("AppMapping") & "/" & getSetting("TransferSettings").Definitions>
<cfset var TransferFactory = CreateObject("component","transfer.TransferFactory").init(DSFile,TFile,Definitions)>
<!--- Place in Cache Indefinetely --->
<cfset getColdBoxOCM().set("TransferFactory",TransferFactory, 0)>
</cffunction>
|
|
Link | Top | Bottom
|
lmajano
Veteran Master
Joined: 01/29/05
Posts: 1142 |
RE: A timeout occurred while attempting to lock
07/29/08 7:32 PM
I would be very interested to see what technical issues would they be talking about. I don't see what?
It also seems you are using transfer. This framework is super big on cfc's and will bog the entire app down due to the classloading bug. Unfortunately, this is out of our control. No settings or changings will make it go faster unless they udpate the JDK to run 1.5 or the beta version of 1.6.
Luis Luis Majano
|
|
Link | Top | Bottom
|
ipggi
Newbie
Joined: 07/28/08
Posts: 9 |
RE: A timeout occurred while attempting to lock
07/29/08 8:18 PM
lmajano they told me precisely what the problem was but I didn't want to ramble on here, hence I used that 'technical reasons' term.
Essentially all the shared hosting servers are mirrored off the same image, so all the servers are using Java 1.6. The VPS accounts are pre-installed the same way and 'actually use a virtual version of Coldfusion on the hardware node'. Their ColdFusion license only covers virtual installations of ColdFusion across hardware nodes.
So the only way I could use a ColdFusion 8 VPS with Java 1.5 is if I bought a non-CF VPS account, provided my own CFML server software and set it up myself.
|
|
Link | Top | Bottom
|
sanaullah73
Veteran Master
Joined: 08/18/06
Posts: 405 |
RE: A timeout occurred while attempting to lock
08/05/08 5:33 PM
Hi,
I have another crazy idea to load TRANSFER on shared hosting
<cfthread action="run" name="myThread">
<cfset Application.TransferFactory = CreateObject("component","transfer.TransferFactory").init(DSFile,TFile,Definitions)>
</cfthread>
I know this might be good if home-page does not need to hit the database/transfer calls etc.
Once the home-page up and running (also thread will load transferfactory in Application scope)
Please let me know if this works for you. Sana Sana
|
|
Link | Top | Bottom
|
ipggi
Newbie
Joined: 07/28/08
Posts: 9 |
RE: A timeout occurred while attempting to lock
08/05/08 6:20 PM
Thanks for the try Sana but it doesn't help. The same locked timeouts keep occurring.
I am just going to move the site to a ColdFusion 7 server.
|
|
Link | Top | Bottom
|
jccady
Joined: 08/26/08
Posts: 1 |
RE: A timeout occurred while attempting to lock
08/26/08 3:33 PM
We're running into the same locking issues and trying to work around it.
The problem is not exclusive to CF8 & > JDK 1.5.
We are currently experienceing these problems on CF 7.0.2 with java 1.4.2_09.
We are working on moving our java up to 1.5 to see if that helps our issues.
I am using CCT (Coldbox, Coldspring, Transfer) for my applications. I just thought I would share the input so people know that moving back to 7 doesn't necessarily solve the problem.
|
|
Link | Top | Bottom
|
lmajano
Veteran Master
Joined: 01/29/05
Posts: 1142 |
RE: A timeout occurred while attempting to lock
08/26/08 3:49 PM
I know that Mark was working on locking issues with cf7 for transfer. The only locking issues I have seen have been on jdk 1.6 and on cf7 when a cf thread get's stuck. For some reason the lock is never released, and well, the framework goes into a halt waiting for the lock to be released if they had an exclusive lock. I have seen this in cf7 and not cf8, and it seemed more related to how CF was doing the locking and how the code got locked.
The best way to analyze this, is by getting a thread dump from the JVM and doing a thread analysis, to see why it got stuck. In cf7, this could mean blocking I/O calls, since jdk 1.4 did not support non-blocking IO like the new JDK's do.
Again, this can be related to one little needle in a huge haystack. Especially if you have coldspring, coldbox and transfer in the mix. Luis Majano
|
|
Link | Top | Bottom
|
kostjanix
Joined: 08/28/08
Posts: 1 |
RE: A timeout occurred while attempting to lock
08/28/08 7:34 AM
I got the same error from time to time and I don't use transfer or any ORM. Just normal SQL. The problem with this error is, that it is useless for debugging.
It happend to me on cf8 running on a mac book pro. I was solving this error by either reverting my last programm steps or checking my cfc's. It came out that there were an error in one of my cfc's, but instead of telling me where and what, the server did'nt release the session and halt the request.... giving me that useless error message.
I know that's maybe not very helpful, but I just wanted to say that it happens here and then also without cf8 and tranfer.
take care, sami
|
|
Link | Top | Bottom
|
sanaullah73
Veteran Master
Joined: 08/18/06
Posts: 405 |
RE: A timeout occurred while attempting to lock
08/28/08 9:23 AM
Hi Sami,
I just tested few things and found that production server should have all production settings turned on. Otherwise there are many concurrent requests which can cause issue of cflock.
Please just make sure that you have these settings adjusted on production server.
<Setting name="HandlersIndexAutoReload" value="false" />
<Setting name="ConfigAutoReload" value="false" />
<Setting name="HandlerCaching" value="true"/>
Please let us know if there still any problems.
Thanks Sana
|
|
Link | Top | Bottom
|
lmajano
Veteran Master
Joined: 01/29/05
Posts: 1142 |
RE: A timeout occurred while attempting to lock
08/28/08 12:44 PM
Sami,
Unfortunately, we can't control how coldfusion behaves on locking issues. I have seen very weird things where it releases normally and sometimes it becomes stubborn and doesn't release the locks. So I am at a loss on that. We run tons of production systems with ColdBox and rarely see the locking errors, unless something is blocked.
Luis Luis Majano
|
|
Link | Top | Bottom
|