Re: [Codenarc-user] 60min timeout when analyzing my project
Brought to you by:
chrismair
From: R. S. <ren...@go...> - 2011-03-28 16:42:00
|
Hi Hamlet, here are some more details as requested. 1) We use a lot of "import some.path.*" in our tests. I know that Groovy supports relative imports and the Groovy compiler has a hard time with it. For GroovyEclipse there was already a performance patch to handle this in a better way This reduced compile time by factor of ~10 as I remember. 2) codenarc.properties # method names can also contain spaces, " and ' (nice test descriptions) MethodName.regex = [a-z][\\w "']* 3) build.xml (excerpt): <target name="codenarc"> <delete dir="logs/codenarc"/> <mkdir dir="logs/codenarc"/> <taskdef name="codenarc" classname="org.codenarc.ant.CodeNarcTask"> <classpath> <fileset dir="lib" includes="log4j*jar"/> <fileset dir="lib" includes="antlr*jar"/> <fileset dir="lib" includes="asm*jar"/> <fileset dir="lib" includes="groovy*jar"/> <fileset dir="lib" includes="CodeNarc*.jar"/> <fileset dir="lib" includes="GMetrics*.jar"/> </classpath> </taskdef> <codenarc ruleSetFiles="rulesets/basic.xml, rulesets/braces.xml, rulesets/concurrency.xml, rulesets/design.xml, rulesets/dry.xml, rulesets/exceptions.xml, rulesets/generic.xml, rulesets/imports.xml, rulesets/junit.xml, rulesets/logging.xml, rulesets/naming.xml, rulesets/size.xml, rulesets/unnecessary.xml, rulesets/unused.xml"> <fileset dir="src"> <include name="**/*.groovy"/> </fileset> <report type="xml"> <option name="outputFile" value="logs/codenarc/CodeNarcReport.xml"/> </report> <report type="html"> <option name="outputFile" value="logs/codenarc/CodeNarcReport.html"/> </report> </codenarc> </target> 4) stacktrace (after 60min) build.xml:878: java.lang.AssertionError: Thread Pool terminated before completion.. Expression: completed. Values: completed = false at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:388) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:662) at org.codenarc.ant.AntFileSetSourceAnalyzer.executeWithThreadPool(AntFileSetSourceAnalyzer.groovy:134) at org.codenarc.ant.AntFileSetSourceAnalyzer.this$2$executeWithThreadPool(AntFileSetSourceAnalyzer.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149) at org.codenarc.ant.AntFileSetSourceAnalyzer.processFileSet(AntFileSetSourceAnalyzer.groovy:118) at org.codenarc.ant.AntFileSetSourceAnalyzer.this$2$processFileSet(AntFileSetSourceAnalyzer.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153) at org.codenarc.ant.AntFileSetSourceAnalyzer$_analyze_closure1.doCall(AntFileSetSourceAnalyzer.groovy:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) at groovy.lang.Closure.call(Closure.java:282) at groovy.lang.Closure.call(Closure.java:295) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1220) at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1196) at org.codehaus.groovy.runtime.dgm$110.invoke(Unknown Source) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270) at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) at org.codenarc.ant.AntFileSetSourceAnalyzer.analyze(AntFileSetSourceAnalyzer.groovy:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:63) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) at org.codenarc.CodeNarcRunner.execute(CodeNarcRunner.groovy:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:63) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at org.codenarc.ant.CodeNarcTask.execute(CodeNarcTask.groovy:86) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) at org.apache.tools.ant.Project.executeTarget(Project.java:1329) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1212) at org.apache.tools.ant.Main.runBuild(Main.java:801) at org.apache.tools.ant.Main.startAnt(Main.java:218) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Regards, René Scheibe On 03/28/2011 04:06 PM, Hamlet DArcy wrote: > This doesn't sound right. > I run it against much larger projects than this with no issues. > > 20 minutes is a crazy long time for this to run. > > Can you post your configuration file? > How about your ant.xml file? > And how about a stack trace? > > Thanks, > Hamlet > > ----- Original Message ----- >> Hi, >> >> I have a project with 200+ Groovy files (30k+ LOC) which I try to >> analyse with CodeNarc. >> >> I am running CodeNarc via Ant. With default settings it runs ~20min, >> spits out a report but also generates a lot of OOMEs. The results >> vary a >> lot since sometimes some classes can be analysed and sometimes they >> can't due to this memory issue. >> >> So I had to increase the memory: >> export ANT_OPTS='-Xmx512m -XX:MaxPermSize=512m' >> >> With this settings after 60min I get this error: >> "java.lang.AssertionError: Thread Pool terminated before completion.. >> Expression: completed. Values: completed = false" >> >> I have seen your pre-v0.13 post that there are some issue and I have >> seen the POOL_TIMEOUT_SECONDS in AntFileSetSourceAnalyzer. >> >> Can you explain the root of the problem? And is there already a >> solution >> for it? >> >> Regards, >> René Scheibe >> >> >> ------------------------------------------------------------------------------ >> Enable your software for Intel(R) Active Management Technology to >> meet the >> growing manageability and security demands of your customers. >> Businesses >> are taking advantage of Intel(R) vPro (TM) technology - will your >> software >> be a part of the solution? Download the Intel(R) Manageability >> Checker >> today! http://p.sf.net/sfu/intel-dev2devmar >> _______________________________________________ >> Codenarc-user mailing list >> Cod...@li... >> https://lists.sourceforge.net/lists/listinfo/codenarc-user >> |