Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-19086

Expensive search of tasks is done every time a check for a running tree rebuild operation is done

    XMLWordPrintable

    Details

      Description

      The changes introduced in NEXUS-15216 cause a potentially expensive query to be run frequently. The check to see if a tree rebuild is in progress iterates over all configured scheduled tasks.

      One of our users was complaining of high CPU usage in Nexus Repo 3.15.2, and provided a number of thread dumps. Most of them showed stack traces like the one below, which illustrates the problem.  Full thread dump is attached.

       

      "qtp540936684-5695" #5695 prio=5 os_prio=0 tid=0x00007f53b4078000 nid=0x18d4 runnable [0x00007f51156fc000]
       java.lang.Thread.State: RUNNABLE
       at java.util.HashMap.hash(HashMap.java:339)
       at java.util.HashMap.containsKey(HashMap.java:596)
       at com.orientechnologies.orient.core.db.record.OTrackedMap.put(OTrackedMap.java:66)
       at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.readEmbeddedMap(ORecordSerializerBinaryV0.java:580)
       at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.deserializeValue(ORecordSerializerBinaryV0.java:472)
       at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.readEmbeddedMap(ORecordSerializerBinaryV0.java:576)
       at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.deserializeValue(ORecordSerializerBinaryV0.java:472)
       at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.deserialize(ORecordSerializerBinaryV0.java:277)
       at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.fromStream(ORecordSerializerBinary.java:80)
       at com.orientechnologies.orient.core.record.impl.ODocument.deserializeFields(ODocument.java:1854)
       at org.sonatype.nexus.orient.entity.EntityAdapter.readEntity(EntityAdapter.java:281)
       at org.sonatype.nexus.orient.entity.IterableEntityAdapter.transformEntity(IterableEntityAdapter.java:63)
       at org.sonatype.nexus.orient.entity.IterableEntityAdapter$$Lambda$140/572904741.apply(Unknown Source)
       at com.google.common.collect.Iterators$6.transform(Iterators.java:788)
       at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
       at com.google.common.collect.Iterators$5.computeNext(Iterators.java:638)
       at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
       at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
       at com.google.common.collect.Iterators$5.computeNext(Iterators.java:637)
       at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
       at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
       at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl.getJobKeys(JobStoreImpl.java:434)
       at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl.lambda$9(JobStoreImpl.java:424)
       at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl$$Lambda$185/1319369460.execute(Unknown Source)
       at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl$$Lambda$186/1709170351.apply(Unknown Source)
       at org.sonatype.nexus.orient.transaction.OrientOperations.lambda$1(OrientOperations.java:56)
       at org.sonatype.nexus.orient.transaction.OrientOperations$$Lambda$130/344325351.call(Unknown Source)
       at org.sonatype.nexus.transaction.OperationPoint.proceed(OperationPoint.java:64)
       at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
       at org.sonatype.nexus.transaction.Operations.transactional(Operations.java:200)
       at org.sonatype.nexus.transaction.Operations.call(Operations.java:146)
       at org.sonatype.nexus.orient.transaction.OrientOperations.call(OrientOperations.java:56)
       at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl.execute(JobStoreImpl.java:202)
       - locked <0x00000006c69c82d8> (a java.lang.Object)
       at org.sonatype.nexus.quartz.internal.orient.JobStoreImpl.getJobKeys(JobStoreImpl.java:424)
       at org.quartz.core.QuartzScheduler.getJobKeys(QuartzScheduler.java:1433)
       at org.quartz.impl.StdScheduler.getJobKeys(StdScheduler.java:470)
       at org.sonatype.nexus.quartz.internal.QuartzSchedulerSPI.allTasks(QuartzSchedulerSPI.java:721)
       at org.sonatype.nexus.quartz.internal.QuartzSchedulerSPI.listsTasks(QuartzSchedulerSPI.java:565)
       at org.sonatype.nexus.quartz.internal.QuartzSchedulerSPI$$EnhancerByGuice$$4f1d6446.CGLIB$listsTasks$5(<generated>)
       at org.sonatype.nexus.quartz.internal.QuartzSchedulerSPI$$EnhancerByGuice$$4f1d6446$$FastClassByGuice$$d58f92b3.invoke(<generated>)
       at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
       at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:76)
       at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
       at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
       at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
       at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:77)
       at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
       at org.sonatype.nexus.quartz.internal.QuartzSchedulerSPI$$EnhancerByGuice$$4f1d6446.listsTasks(<generated>)
       at org.sonatype.nexus.scheduling.internal.TaskSchedulerImpl.listsTasks(TaskSchedulerImpl.java:136)
       at org.sonatype.nexus.repository.browse.internal.BrowseFacetImpl.isRebuilding(BrowseFacetImpl.java:45)
       at sun.reflect.GeneratedMethodAccessor238.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       at org.codehaus.groovy.runtime.metaclass.MethodMetaProperty$GetBeanMethodMetaProperty.getProperty(MethodMetaProperty.java:76)
       at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:63)
       at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:299)
       at org.sonatype.nexus.coreui.BrowseComponent$_getState_closure2.doCall(BrowseComponent.groovy:101)
       at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
       at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
       at groovy.lang.Closure.call(Closure.java:418)
       at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54)
       at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:124)
       at com.sun.proxy.$Proxy241.test(Unknown Source)
       at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
       at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
       at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
       at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
       at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
       at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
       at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
       at java_util_stream_Stream$collect.call(Unknown Source)
       at org.sonatype.nexus.coreui.BrowseComponent.getState(BrowseComponent.groovy:104)

        Attachments

          Activity

            People

            Assignee:
            dbradicich Damian Bradicich
            Reporter:
            rseddon Rich Seddon
            Last Updated By:
            Joe Tom
            Team:
            NXRM - Tron
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title