本文介绍了sonarqube“应用项目排除项"非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用的是sonarqube 5.1.1,通常应用项目排除项"步骤非常非常缓慢.有时在1-2.5小时范围内.

We are using sonarqube 5.1.1 and often the step "Apply project exclusions" is very, very slow. In the range of 1-2.5 hours sometimes.

我们有全局源文件排除项"来排除2种模式:**/swagger-ui/****/*.min.js

We have "Global Source File Exclusions" to exclude 2 patterns:**/swagger-ui/****/*.min.js

我不确定这是多近的更改,因为我们的声纳波构建每晚运行一次.

I'm not sure how recent a change this is because our sonarqube builds are run nightly.

更新:我按照请求进行了线程转储,看起来它正在等待数据库连接. 全线程转储Java HotSpot(TM)服务器VM(24.79-b02混合模式):

Update: I did a thread dump as requested and it looks like it's waiting on an db connection. Full thread dump Java HotSpot(TM) Server VM (24.79-b02 mixed mode):

"pool-2-thread-1" prio=10 tid=0x9e43cc00 nid=0x6e88 waiting on condition [0xa0151000]
   java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0xbfc6bd60> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1090)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

"CLEANUP_MANAGER" prio=10 tid=0x9e209000 nid=0x46b1 in Object.wait() [0x9ed8d000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb9217dd8> (a com.persistit.CleanupManager)
    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:173)
    - locked <0xb9217dd8> (a com.persistit.CleanupManager)
    at java.lang.Thread.run(Thread.java:745)

"CHECKPOINT_WRITER" prio=10 tid=0x9f827000 nid=0x46af in Object.wait() [0x9f05d000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb9218080> (a com.persistit.CheckpointManager)
    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:173)
    - locked <0xb9218080> (a com.persistit.CheckpointManager)
    at java.lang.Thread.run(Thread.java:745)

"TXN_UPDATE" prio=10 tid=0x9e21dc00 nid=0x46a8 in Object.wait() [0x9f0ad000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb92182e0> (a com.persistit.TransactionIndex$ActiveTransactionCachePollTask)
    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:173)
    - locked <0xb92182e0> (a com.persistit.TransactionIndex$ActiveTransactionCachePollTask)
    at java.lang.Thread.run(Thread.java:745)

"PAGE_WRITER:8192" prio=10 tid=0x9e217000 nid=0x46a2 in Object.wait() [0x9f0fe000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb9396070> (a com.persistit.BufferPool$PageWriter)
    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:173)
    - locked <0xb9396070> (a com.persistit.BufferPool$PageWriter)
    at java.lang.Thread.run(Thread.java:745)

"JOURNAL_FLUSHER" prio=10 tid=0x9e216000 nid=0x46a1 in Object.wait() [0x9f260000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb923c088> (a com.persistit.JournalManager$JournalFlusher)
    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:173)
    - locked <0xb923c088> (a com.persistit.JournalManager$JournalFlusher)
    at java.lang.Thread.run(Thread.java:745)

"JOURNAL_COPIER" prio=10 tid=0x9e215800 nid=0x46a0 in Object.wait() [0x9f2b1000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xba48e0c8> (a com.persistit.JournalManager$JournalCopier)
    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:173)
    - locked <0xba48e0c8> (a com.persistit.JournalManager$JournalCopier)
    at java.lang.Thread.run(Thread.java:745)

"LOG_FLUSHER" daemon prio=10 tid=0x9e5f3800 nid=0x4686 waiting on condition [0x9fe83000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at com.persistit.util.Util.sleep(Util.java:558)
    at com.persistit.Persistit$LogFlusher.run(Persistit.java:188)

"Service Thread" daemon prio=10 tid=0x08341400 nid=0x4208 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=10 tid=0x0833fc00 nid=0x4207 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=10 tid=0x08335000 nid=0x4206 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x08333400 nid=0x4205 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0x0831dc00 nid=0x4204 in Object.wait() [0xa0547000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb4c477e8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
    - locked <0xb4c477e8> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" daemon prio=10 tid=0x0831c400 nid=0x4203 in Object.wait() [0xa0598000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xb4c47408> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:503)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
    - locked <0xb4c47408> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0x08051000 nid=0x41f7 runnable [0xf709f000]
   java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:152)
    at java.net.SocketInputStream.read(SocketInputStream.java:122)
    at oracle.net.ns.Packet.receive(Packet.java:300)
    at oracle.net.ns.DataPacket.receive(DataPacket.java:106)
    at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:260)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:185)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:102)
    at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124)
    at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:884)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)
    - locked <0xb6f5bba0> (a oracle.jdbc.driver.T4CConnection)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)
    at org.hibernate.loader.Loader.doQuery(Loader.java:697)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    at org.hibernate.loader.Loader.doList(Loader.java:2232)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
    at org.hibernate.loader.Loader.list(Loader.java:2124)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
    at org.sonar.jpa.session.JpaDatabaseSession.getSingleResult(JpaDatabaseSession.java:207)
    at org.sonar.jpa.session.JpaDatabaseSession.getSingleResult(JpaDatabaseSession.java:238)
    at org.sonar.batch.index.ResourcePersister.updateUuids(ResourcePersister.java:291)
    at org.sonar.batch.index.ResourcePersister.findOrCreateModel(ResourcePersister.java:251)
    at org.sonar.batch.index.ResourcePersister.persistFileOrDirectory(ResourcePersister.java:218)
    at org.sonar.batch.index.ResourcePersister.persist(ResourcePersister.java:166)
    at org.sonar.batch.index.ResourcePersister.persist(ResourcePersister.java:103)
    at org.sonar.batch.index.ResourcePersister.persist(ResourcePersister.java:77)
    at org.sonar.batch.scan.filesystem.ComponentIndexer.execute(ComponentIndexer.java:81)
    at org.sonar.batch.scan.filesystem.DefaultModuleFileSystem.index(DefaultModuleFileSystem.java:223)
    at org.sonar.batch.phases.DatabaseModePhaseExecutor.indexFs(DatabaseModePhaseExecutor.java:153)
    at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:110)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
    at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
    at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
    at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
    at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
    at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
    - locked <0xb6a5e6e0> (a org.sonar.batch.bootstrapper.Batch)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
    at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

"VM Thread" prio=10 tid=0x08319800 nid=0x4202 runnable 

"GC task thread#0 (ParallelGC)" prio=10 tid=0x0805b000 nid=0x41f8 runnable 

"GC task thread#1 (ParallelGC)" prio=10 tid=0x0805c800 nid=0x41f9 runnable 

"GC task thread#2 (ParallelGC)" prio=10 tid=0x0805e000 nid=0x41fa runnable 

"GC task thread#3 (ParallelGC)" prio=10 tid=0x0805f400 nid=0x41fb runnable 

"GC task thread#4 (ParallelGC)" prio=10 tid=0x08060c00 nid=0x41fc runnable 

"GC task thread#5 (ParallelGC)" prio=10 tid=0x08062400 nid=0x41fd runnable 

"GC task thread#6 (ParallelGC)" prio=10 tid=0x08063c00 nid=0x41fe runnable 

"GC task thread#7 (ParallelGC)" prio=10 tid=0x08065000 nid=0x41ff runnable 

"GC task thread#8 (ParallelGC)" prio=10 tid=0x08066800 nid=0x4200 runnable 

"GC task thread#9 (ParallelGC)" prio=10 tid=0x08068000 nid=0x4201 runnable 

"VM Periodic Task Thread" prio=10 tid=0x08343400 nid=0x4209 waiting on condition 

JNI global references: 196

Heap
 PSYoungGen      total 267264K, used 165499K [0xde980000, 0xf3980000, 0xf3f00000)
  eden space 197120K, 81% used [0xde980000,0xe8676998,0xeaa00000)
  from space 70144K, 6% used [0xef500000,0xef9a8568,0xf3980000)
  to   space 73472K, 0% used [0xeaa00000,0xeaa00000,0xef1c0000)
 ParOldGen       total 240384K, used 198415K [0xb3f00000, 0xc29c0000, 0xde980000)
  object space 240384K, 82% used [0xb3f00000,0xc00c3f10,0xc29c0000)
 PSPermGen       total 63488K, used 34483K [0xa3f00000, 0xa7d00000, 0xb3f00000)
  object space 63488K, 54% used [0xa3f00000,0xa60ace98,0xa7d00000)

关于解决方法或解决方案有什么建议吗?

Any suggestions on work arounds or solutions?

推荐答案

创建的票证: SONAR-6839 ,有关此主题的任何进一步讨论,最好只对这张Jira票进行评论

Ticket created : SONAR-6839, for any further discussions on this subject, would be better to simply comment this Jira ticket

这篇关于sonarqube“应用项目排除项"非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 21:39