Error with Logger in CB

Hi Brad,

About midday something strange started happening with CB. It would randomly shut down after displaying a long error message. It kept happening so was able to grab the error attached. It consistently referenced

Tag Context:
C:\Users\djcar.CommandBox\cfml\system\wirebox\system\logging\Logger.cfc: line 68

which is this:

<!--- hasAppenders --->
<cffunction name="hasAppenders" output="false" access="public" returntype="any" hint="Checks to see if we have registered any appenders yet" colddoc:generic="boolean">
   <cflock name="#instance.lockName#" type="readonly" throwontimeout="true" timeout="#instance.lockTimeout#">
      <cfreturn NOT structIsEmpty(instance.appenders)>
   </cflock>
</cffunction>


I was messing around with using CB with Team City and automating some builds so it's possible I did something but don't know what it could have been.

Dan

CommandBoxError.txt (10.3 KB)

Which version of CommandBox and what was the error?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

CommandBox 3.9.2+00826 and it says

Tag Context:
C:\Users\djcar\.CommandBox\cfml\system\wirebox\system\logging\Logger.cfc: line 68
called from C:\Users\djcar\.CommandBox\cfml\system\wirebox\system\logging\Logger.cfc: line 315
called from C:\Users\djcar\.CommandBox\cfml\system\wirebox\system\logging\Logger.cfc: line 269
called from C:\Users\djcar\.CommandBox\cfml\system\Shell.cfc: line 538
called from C:\Users\djcar\.CommandBox\cfml\system\Shell.cfc: line 425
called from C:\Users\djcar\.CommandBox\cfml\system\Bootstrap.cfm: line 113

java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326):1326
        at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.tryLock(ReentrantReadWriteLock.java:871):871
        at lucee.commons.lock.rw.RWLock.lock(RWLock.java:48):48

The whole error dump is in the text file I attached.I think this is the relevant portion though.

Dan

That means the main thread was interrupted. Are you sure you’re not on CommandBox 4.0, or haven’t somehow intermixed that code? CommandBox 4.0 now interrupts the thread when Ctrl+C is pressed, but the framework catches it and handles it. I can’t imagine any way in CommandBox 3.9 that the thread would be interrupted unless you’ve got code somewhere like this:

createObject( ‘java’, ‘java.lang.Thread’ ).getCurrentThread().interrupt();

Or unless Lucee was trying to time out the request for some reason. (The request timeout inside the CLI is set to 999,999 days)

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Gotcha. Nope. No Java code like that as far as I know. That version is what came when I typed version but anything is possible. I’ll reinstall it. I was installing and removing modules today as part of a process so I may have deleted or overwritten something. That snippet came up each time and it was in a cflock so didn’t know if something was locking and not letting go like the file system issue. Anyway. Just thought I’d throw it out there. I’ll reinstall it in case I did something.

Have a good weekend. :slight_smile:

Dan

For what it’s worth, once a thread is interrupted, any library that checks the interrupted status will throw that exception until Thread.interrupted() is called which ‘resets’ it so to speak. There are a number of places in CF that check to see if the thread is interrupted, and cflock is one of them. I found that out when I was working on CommandBox 4.0 and was figuring out how to correct interrupt threads and then handle that interruption. The question is how the thread got interrupted, but I’m not sure there’s a way to tell that.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Mystery solved then. It was usually after something I was working on puked which probably caused the initial thread implosion. It would exit out of my thing and then after a few minutes it would do the shut down thing. Never Mind!