我有一个使用spring boot构建的应用程序。我在使用SmartLifeCycle启动的应用程序中有kafka使用者。
同样的应用程序也连接到Mongo,有时我的应用程序挂起,我看到很少被阻塞的线程,并且线程转储的次数不同。但大多数问题似乎是startConsumerService方法,它有无限循环。虽然我使用stopConsumer方法调用kafkaConsumer.wakeup(),但有时消费者似乎没有干净地停止
public class KafkaMessageConsumer implements MessageConsumer, SmartLifecycle {
private static final Logger LOGGER = LoggerFactory.getLogger(KafkaMessageConsumer.class);
private List<String> topicNames;
private boolean isRunning = false;
private boolean isAutoStartUp = true;
private MessageListener messageListener;
private ThreadPoolTaskExecutor executor;
@Autowired
private Consumer<String, String> kafkaConsumer;
public KafkaMessageConsumer(List<String> topicNames, MessageListener messageListener) {
Assert.notEmpty(topicNames, "topicNames cannot be null");
Assert.notNull(messageListener, "MessageListner cannot be null");
this.topicNames = topicNames;
this.messageListener = messageListener;
}
/**
* <p> This method polls for messages with respective to the topic specified, it waits till a
* message is received and if not it continues waiting , when a call to stopConsumer is made a
* WakeupException is thrown which then breaks infinite while loop and then the kafka consumer is
* closed</p>
*
* @param topicName
*/
private void startConsumerService(List<String> topicName) {
try {
kafkaConsumer.subscribe(topicName);
while (true) {
ConsumerRecords<String, String> records = kafkaConsumer.poll(Long.MAX_VALUE);
Iterator<ConsumerRecord<String, String>> iterator = records.iterator();
while (iterator.hasNext()) {
ConsumerRecord<String, String> consumerRecord = iterator.next();
LOGGER.debug("Recevived Message {}", consumerRecord.value());
messageListener.onMessage(consumerRecord.value());
}
}
} catch (WakeupException ex) {
// Ignore this exception this is for shutting down the consumer
LOGGER.info("Shutting down the consumer", ex);
} finally {
kafkaConsumer.close();
}
}
@Override
public void stopConsumer() {
if (isRunning) {
kafkaConsumer.wakeup();
executor.setWaitForTasksToCompleteOnShutdown(true);
executor.shutdown();
LOGGER.info("Kafka Consumer stopped : {} ", executor.getThreadPoolExecutor().isShutdown());
this.isRunning = false;
}
}
@Override
public void connectToRecive(List<String> topicName) {
if (!isRunning) {
executor = new ThreadPoolTaskExecutor();
executor.afterPropertiesSet();
executor.submit(() -> startConsumerService(topicName));
LOGGER.info("Kafka Consumer started : {} ", !executor.getThreadPoolExecutor().isShutdown());
isRunning = true;
}
}
@Override
public void start() {
connectToRecive(this.topicNames);
}
@Override
public void stop() {
stopConsumer();
}
@Override
public boolean isRunning() {
return this.isRunning;
}
@Override
public int getPhase() {
return 1;
}
@Override
public boolean isAutoStartup() {
return this.isAutoStartUp;
}
@Override
public void stop(Runnable callback) {
stopConsumer();
Thread callBackRunnerThread = new Thread(callback);
callBackRunnerThread.start();
}
}
这是线程转储:
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.72-b15 mixed mode):
"http-nio-auto-1-49201-AsyncTimeout" #32 daemon prio=5 os_prio=31 tid=0x00007fdcdf44a000 nid=0x7003 sleeping[0x00007000022fc000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.coyote.AbstractProtocol$AsyncTimeout.run(AbstractProtocol.java:1120)
at java.lang.Thread.run(Thread.java:745)
"http-nio-auto-1-Acceptor-0" #31 daemon prio=5 os_prio=31 tid=0x00007fdcde8a8800 nid=0x6e03 runnable [0x00007000021f9000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
- locked <0x0000000730e5e400> (a java.lang.Object)
at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:457)
at java.lang.Thread.run(Thread.java:745)
"http-nio-auto-1-ClientPoller-1" #30 daemon prio=5 os_prio=31 tid=0x00007fdcdf449800 nid=0x6c03 runnable [0x00007000020f6000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:117)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000730e3e8c0> (a sun.nio.ch.Util$2)
- locked <0x0000000730e3e8b0> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000730e3e780> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:791)
at java.lang.Thread.run(Thread.java:745)
"http-nio-auto-1-ClientPoller-0" #29 daemon prio=5 os_prio=31 tid=0x00007fdcdeb6f800 nid=0x6a07 runnable [0x0000700001ff3000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:117)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000730e5eb78> (a sun.nio.ch.Util$2)
- locked <0x0000000730e5eb68> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000730e5ea38> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:791)
at java.lang.Thread.run(Thread.java:745)
"NioBlockingSelector.BlockPoller-1" #28 daemon prio=5 os_prio=31 tid=0x00007fdcdeb6f000 nid=0x410f runnable [0x0000700001ae4000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:198)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:117)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
- locked <0x0000000730e5f348> (a sun.nio.ch.Util$2)
- locked <0x0000000730e5f338> (a java.util.Collections$UnmodifiableSet)
- locked <0x0000000730e5f218> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:339)
"ThreadPoolTaskExecutor-1" #27 prio=5 os_prio=31 tid=0x00007fdcdd5de000 nid=0x5b0b runnable [0x00007000019e0000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.SocketOptionRegistry.findOption(SocketOptionRegistry.java:81)
at sun.nio.ch.Net.setSocketOption(Net.java:320)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:190)
- locked <0x000000076aac1dd0> (a java.lang.Object)
at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:271)
at sun.nio.ch.SocketAdaptor.setKeepAlive(SocketAdaptor.java:370)
at org.apache.kafka.common.network.Selector.connect(Selector.java:146)
at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:489)
at org.apache.kafka.clients.NetworkClient.access$400(NetworkClient.java:47)
at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeUpdate(NetworkClient.java:624)
at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeUpdate(NetworkClient.java:543)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:254)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.clientPoll(ConsumerNetworkClient.java:320)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:213)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:193)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.awaitMetadataUpdate(ConsumerNetworkClient.java:134)
at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorKnown(AbstractCoordinator.java:184)
at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureActiveGroup(AbstractCoordinator.java:212)
at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.ensurePartitionAssignment(ConsumerCoordinator.java:311)
at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:890)
at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:853)
at com.test.proj.shared.adapter.message.KafkaMessageConsumer.startConsumerService(KafkaMessageConsumer.java:52)
at com.test.proj.shared.adapter.message.KafkaMessageConsumer.lambda$0(KafkaMessageConsumer.java:89)
at com.test.proj.shared.adapter.message.KafkaMessageConsumer$$Lambda$1/2113243119.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"kafka-producer-network-thread | producer-2" #26 daemon prio=5 os_prio=31 tid=0x00007fdcde27a000 nid=0x6803 runnable [0x0000700001ef0000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.SocketAdaptor.create(SocketAdaptor.java:67)
at sun.nio.ch.SocketChannelImpl.socket(SocketChannelImpl.java:140)
- locked <0x000000076aac20b0> (a java.lang.Object)
at org.apache.kafka.common.network.Selector.connect(Selector.java:145)
at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:489)
at org.apache.kafka.clients.NetworkClient.access$400(NetworkClient.java:47)
at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeUpdate(NetworkClient.java:624)
at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeUpdate(NetworkClient.java:543)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:254)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:216)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:128)
at java.lang.Thread.run(Thread.java:745)
"smtp:localhost:29971" #25 prio=5 os_prio=31 tid=0x00007fdce1535800 nid=0x6603 runnable [0x0000700001ded000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
at java.net.ServerSocket.implAccept(ServerSocket.java:545)
at java.net.ServerSocket.accept(ServerSocket.java:513)
at com.icegreen.greenmail.server.AbstractServer.run(AbstractServer.java:95)
"container-0" #24 prio=5 os_prio=31 tid=0x00007fdcdfb0f800 nid=0x6403 runnable [0x0000700001cea000]
java.lang.Thread.State: RUNNABLE
at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer$1.run(TomcatEmbeddedServletContainer.java:167)
"ContainerBackgroundProcessor[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]" #23 daemon prio=5 os_prio=31 tid=0x00007fdce0318000 nid=0x6207 waiting on condition [0x0000700001be7000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1339)
at java.lang.Thread.run(Thread.java:745)
"AsyncAppender-asyncappender" #19 daemon prio=5 os_prio=31 tid=0x00007fdcdfa08800 nid=0x6003 waiting on condition [0x00007000018de000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006d0868b40> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
at org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.run(AsyncAppender.java:282)
"kafka-producer-network-thread | producer-1" #18 daemon prio=5 os_prio=31 tid=0x00007fdcdbf71000 nid=0x5e0f runnable [0x00007000017da000]
java.lang.Thread.State: RUNNABLE
at java.lang.String.substring(String.java:1969)
at javax.management.ObjectName.getCanonicalKeyPropertyListString(ObjectName.java:1741)
at com.sun.jmx.mbeanserver.Repository.remove(Repository.java:632)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterFromRepository(DefaultMBeanServerInterceptor.java:1940)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:448)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:415)
at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:546)
at org.apache.kafka.common.metrics.JmxReporter.unregister(JmxReporter.java:148)
at org.apache.kafka.common.metrics.JmxReporter.reregister(JmxReporter.java:155)
at org.apache.kafka.common.metrics.JmxReporter.metricChange(JmxReporter.java:77)
- locked <0x00000006d0581678> (a java.lang.Object)
at org.apache.kafka.common.metrics.Metrics.registerMetric(Metrics.java:288)
- locked <0x00000006d0449e08> (a org.apache.kafka.common.metrics.Metrics)
at org.apache.kafka.common.metrics.Sensor.add(Sensor.java:177)
- locked <0x000000076aac18c8> (a org.apache.kafka.common.metrics.Sensor)
at org.apache.kafka.common.metrics.Sensor.add(Sensor.java:162)
at org.apache.kafka.common.network.Selector$SelectorMetrics.maybeRegisterConnectionMetrics(Selector.java:659)
at org.apache.kafka.common.network.Selector.poll(Selector.java:268)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:256)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:216)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:128)
at java.lang.Thread.run(Thread.java:745)
"ThreadPoolTaskExecutor-1" #13 prio=5 os_prio=31 tid=0x00007fdcdbb6c000 nid=0x5803 waiting on condition [0x00007000016d8000]
java.lang.Thread.State: RUNNABLE
at org.apache.kafka.clients.consumer.KafkaConsumer$$EnhancerByMockitoWithCGLIB$$eec0fc4.poll(<generated>)
at com.test.proj.shared.adapter.message.KafkaMessageConsumer.startConsumerService(KafkaMessageConsumer.java:52)
at com.test.proj.shared.adapter.message.KafkaMessageConsumer.lambda$0(KafkaMessageConsumer.java:89)
at com.test.proj.shared.adapter.message.KafkaMessageConsumer$$Lambda$1/2113243119.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
"ReaderThread" #10 prio=5 os_prio=31 tid=0x00007fdcde07a800 nid=0x5603 runnable [0x00007000015d5000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
- locked <0x00000006c053ae78> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
- locked <0x00000006c053ae78> (a java.io.InputStreamReader)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner$ReaderThread.run(RemoteTestRunner.java:135)
"Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007fdcdb868000 nid=0x5203 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C1 CompilerThread3" #8 daemon prio=9 os_prio=31 tid=0x00007fdcdf008000 nid=0x5003 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007fdcde00f000 nid=0x4e03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007fdcde006000 nid=0x4c03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007fdcde004800 nid=0x4a03 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fdcde004000 nid=0x3e0f runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fdcdc00b800 nid=0x3803 in Object.wait() [0x0000700000d3a000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000006c054c830> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
- locked <0x00000006c054c830> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fdcdc008800 nid=0x3603 in Object.wait() [0x0000700000c37000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000006c054c888> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
- locked <0x00000006c054c888> (a java.lang.ref.Reference$Lock)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)
"main" #1 prio=5 os_prio=31 tid=0x00007fdcdd002000 nid=0x1703 waiting for monitor entry [0x0000700000216000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:248)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:232)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:192)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:188)
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:79)
at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:2269)
at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1901)
at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1712)
at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:586)
at com.test.proj.sleepdisruptor.cucumber.SleepDisruptorAcceptanceSteps.getMailStatus(SleepDisruptorAcceptanceSteps.java:116)
at com.test.proj.sleepdisruptor.cucumber.SleepDisruptorAcceptanceSteps.the_alert_message_received_by_sleep_disruptor_is_for_the_alert_with(SleepDisruptorAcceptanceSteps.java:104)
at com.test.proj.sleepdisruptor.cucumber.SleepDisruptorAcceptanceSteps$$FastClassBySpringCGLIB$$cc1383a4.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.test.proj.shared.domain.log.MethodMonitor.methodTracelog(MethodMonitor.java:59)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at com.test.proj.sleepdisruptor.cucumber.SleepDisruptorAcceptanceSteps$$EnhancerBySpringCGLIB$$a19c16b1.the_alert_message_received_by_sleep_disruptor_is_for_the_alert_with(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:37)
at cucumber.runtime.Timeout.timeout(Timeout.java:13)
at cucumber.runtime.Utils.invoke(Utils.java:31)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:299)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
"VM Thread" os_prio=31 tid=0x00007fdcde001000 nid=0x3403 runnable
"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fdcdb812800 nid=0x2403 runnable
"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fdcdb813000 nid=0x2603 runnable
"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fdcdb814000 nid=0x2803 runnable
"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fdcdb814800 nid=0x2a03 runnable
"GC task thread#4 (ParallelGC)" os_prio=31 tid=0x00007fdcdb815000 nid=0x2c03 runnable
"GC task thread#5 (ParallelGC)" os_prio=31 tid=0x00007fdcdb815800 nid=0x2e03 runnable
"GC task thread#6 (ParallelGC)" os_prio=31 tid=0x00007fdcdb816800 nid=0x3003 runnable
"GC task thread#7 (ParallelGC)" os_prio=31 tid=0x00007fdcdb817000 nid=0x3203 runnable
"VM Periodic Task Thread" os_prio=31 tid=0x00007fdcdd013000 nid=0x5403 waiting on condition
JNI global references: 757
Heap
PSYoungGen total 873984K, used 408063K [0x000000076ab00000, 0x00000007be580000, 0x00000007c0000000)
eden space 408064K, 99% used [0x000000076ab00000,0x000000078397fff8,0x0000000783980000)
from space 465920K, 0% used [0x0000000783980000,0x0000000783980000,0x00000007a0080000)
to space 460288K, 0% used [0x00000007a2400000,0x00000007a2400000,0x00000007be580000)
ParOldGen total 2796544K, used 2796297K [0x00000006c0000000, 0x000000076ab00000, 0x000000076ab00000)
object space 2796544K, 99% used [0x00000006c0000000,0x000000076aac26f8,0x000000076ab00000)
Metaspace used 61283K, capacity 62496K, committed 62592K, reserved 1103872K
class space used 7976K, capacity 8271K, committed 8320K, reserved 1048576K
不确定这里发生了什么?