JBoss WorkManager Thread处于BLOCKED状态

时间:2016-03-07 06:37:38

标签: jboss spring-integration

我们正在使用JBoss 5和JDK 1.6。我们使用Spring集成来轮询来自多个目录的文件。

<file:inbound-channel-adapter id="flowInboundFileAdapter" directory="${service.integration.path}" scanner="recursiveScanner" filter="customPathFileFilter"
    channel="myInChannel" auto-create-directory="false" auto-startup="true" prevent-duplicates="true" queue-size="10">
    <poller max-messages-per-poll="10" fixed-rate="10" time-unit="SECONDS" task-executor="taskExecutor" />
  </file:inbound-channel-adapter>
  <beans:bean id="recursiveScanner" class="org.springframework.integration.file.RecursiveLeafOnlyDirectoryScanner" />

我们刚刚从线程转储中实现了所有线程(200个中的198个)在.integration.file.filters.AcceptOnceFileListFilter.accept(AcceptOnceFileListFilter.java:60)中被阻塞。我们不确定这是一个僵局还是其他什么?我们怎么解决呢?我们可以在不重启JBoss的情况下杀死它们吗?

Thread: WorkManager(2)-1 : priority:5, demon:true, threadId:71, threadState:WAITING
- waiting on <0x6b25d66e> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:220)
org.jboss.resource.adapter.mail.inflow.NewMsgsWorker.run(NewMsgsWorker.java:76)
org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

Locked synchronizers : 
- locked <0x699f91ee> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
Thread: WorkManager(2)-2 : priority:5, demon:true, threadId:115, threadState:BLOCKED
- waiting on <0x1f3fd8f5> (a java.lang.Object)
org.springframework.integration.file.filters.AcceptOnceFileListFilter.accept(AcceptOnceFileListFilter.java:60)
org.springframework.integration.file.filters.AbstractFileListFilter.filterFiles(AbstractFileListFilter.java:39)
org.springframework.integration.file.filters.CompositeFileListFilter.filterFiles(CompositeFileListFilter.java:93)
org.springframework.integration.file.DefaultDirectoryScanner.listFiles(DefaultDirectoryScanner.java:69)
org.springframework.integration.file.FileReadingMessageSource.scanInputDirectory(FileReadingMessageSource.java:276)
org.springframework.integration.file.FileReadingMessageSource.receive(FileReadingMessageSource.java:250)
org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:111)
org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:67)
org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236)
org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
com.dashboard.service.security.spring.SecurityContextAwareTaskExecutor$1.run(SecurityContextAwareTaskExecutor.java:26)
org.springframework.jca.work.DelegatingWork.run(DelegatingWork.java:57)
org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

Locked synchronizers : 
- locked <0x12106b7> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
Thread: WorkManager(2)-3 : priority:5, demon:true, threadId:116, threadState:BLOCKED
- waiting on <0x1f3fd8f5> (a java.lang.Object)
org.springframework.integration.file.filters.AcceptOnceFileListFilter.accept(AcceptOnceFileListFilter.java:60)
org.springframework.integration.file.filters.AbstractFileListFilter.filterFiles(AbstractFileListFilter.java:39)
org.springframework.integration.file.filters.CompositeFileListFilter.filterFiles(CompositeFileListFilter.java:93)
org.springframework.integration.file.DefaultDirectoryScanner.listFiles(DefaultDirectoryScanner.java:69)
org.springframework.integration.file.FileReadingMessageSource.scanInputDirectory(FileReadingMessageSource.java:276)
org.springframework.integration.file.FileReadingMessageSource.receive(FileReadingMessageSource.java:250)
org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:111)
org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:67)
org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236)
org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
com.dashboard.service.security.spring.SecurityContextAwareTaskExecutor$1.run(SecurityContextAwareTaskExecutor.java:26)
org.springframework.jca.work.DelegatingWork.run(DelegatingWork.java:57)
org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)

Locked synchronizers : 
- locked <0x4524fab4> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

1 个答案:

答案 0 :(得分:0)

我最好的猜测是你在目录中有大量的文件;每次我们扫描目录时,我们都要检查过滤器中的每一个。

拥有大量文件会降低性能。

在处理文件时,通常最好重命名/删除文件。

如果你不能这样做,你可以试试新的WatchServiceDirectoryScanner。这只会检索新文件。