项目集成Seata服务启动卡住问题分析

容器内执行 jstack 28 | grep -H10 -A10 seata --color 查询seata相关堆栈信息
root@xxxxxxxx:/usr/src/myapp# jstack 28 | grep -H10 -A10 seata --color
(standard input)-       at java.lang.Object.wait(Native Method)
(standard input)-       at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
(standard input)-       - locked(a java.lang.ref.ReferenceQueue$Lock)
(standard input)-       at com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"NettyClientSelector_TMROLE_1" #60 daemon prio=5 os_prio=0 tid=0x00007fdf5c05a800 nid=0x61 in Object.wait() [0x00007fdf65bf3000]
(standard input)-   java.lang.Thread.State: RUNNABLE
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendRequest(AbstractRpcRemoting.java:308)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemotingClient.userEventTriggered(AbstractRpcRemotingClient.java:207)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:340)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:326)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:318)
(standard input)-       at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108)
(standard input)-       at io.netty.handler.codec.ByteToMessageDecoder.userEventTriggered(ByteToMessageDecoder.java:336)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:340)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:326)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:318)
(standard input)-       at io.netty.handler.timeout.IdleStateHandler.channelIdle(IdleStateHandler.java:343)
(standard input)-       at io.netty.handler.timeout.IdleStateHandler$WriterIdleTimeoutTask.run(IdleStateHandler.java:428)
(standard input)-       at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
(standard input)-       at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:120)
(standard input)-       at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
(standard input)-       at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
(standard input)-       at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:454)
(standard input)-       at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"NettyClientSelector_RMROLE_1" #61 daemon prio=5 os_prio=0 tid=0x00007fdf4c295800 nid=0x60 in Object.wait() [0x00007fdf65cf4000]
(standard input)-   java.lang.Thread.State: RUNNABLE
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendRequest(AbstractRpcRemoting.java:308)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemotingClient.userEventTriggered(AbstractRpcRemotingClient.java:207)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:340)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:326)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:318)
(standard input)-       at io.netty.channel.ChannelInboundHandlerAdapter.userEventTriggered(ChannelInboundHandlerAdapter.java:108)
(standard input)-       at io.netty.handler.codec.ByteToMessageDecoder.userEventTriggered(ByteToMessageDecoder.java:336)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:340)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:326)
(standard input)-       at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:318)
(standard input)-       at io.netty.handler.timeout.IdleStateHandler.channelIdle(IdleStateHandler.java:343)
(standard input)-       at io.netty.handler.timeout.IdleStateHandler$WriterIdleTimeoutTask.run(IdleStateHandler.java:428)
--
(standard input)-       at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)
(standard input)-       at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:755)
(standard input)-       at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:410)
(standard input)-       at org.apache.skywalking.apm.dependencies.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
(standard input)-       at org.apache.skywalking.apm.dependencies.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"rpcMergeMessageSend_RMROLE_1" #52 daemon prio=5 os_prio=0 tid=0x00007fe0513a9000 nid=0x5a in Object.wait() [0x00007fdf66cfa000]
(standard input)-   java.lang.Thread.State: TIMED_WAITING (on object monitor)
(standard input)-       at java.lang.Object.wait(Native Method)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemotingClient$MergedSendRunnable.run(AbstractRpcRemotingClient.java:301)
(standard input)-       - locked(a java.lang.Object)
(standard input)-       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
(standard input)-       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"timeoutChecker_2" #51 daemon prio=5 os_prio=0 tid=0x00007fe050b21000 nid=0x59 in Object.wait() [0x00007fdf66dfb000]
(standard input)-   java.lang.Thread.State: RUNNABLE
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequest(AbstractRpcRemoting.java:222)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:197)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:179)
(standard input):       at io.seata.core.rpc.netty.NettyPoolableFactory.makeObject(NettyPoolableFactory.java:66)
(standard input):       at io.seata.core.rpc.netty.NettyPoolableFactory.makeObject(NettyPoolableFactory.java:34)
(standard input)-       at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:206)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:103)
(standard input)-       - locked(a java.lang.Object)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:175)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemotingClient$1.run(AbstractRpcRemotingClient.java:112)
(standard input)-       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
(standard input)-       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
(standard input)-       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
(standard input)-       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"AsyncWorker_1" #50 daemon prio=5 os_prio=0 tid=0x00007fe050b20000 nid=0x58 waiting on condition [0x00007fdf66efc000]
(standard input)-   java.lang.Thread.State: TIMED_WAITING (parking)
--
(standard input)-       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
(standard input)-       at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"rpcMergeMessageSend_TMROLE_1" #49 daemon prio=5 os_prio=0 tid=0x00007fe051d58800 nid=0x57 in Object.wait() [0x00007fdf66ffd000]
(standard input)-   java.lang.Thread.State: TIMED_WAITING (on object monitor)
(standard input)-       at java.lang.Object.wait(Native Method)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemotingClient$MergedSendRunnable.run(AbstractRpcRemotingClient.java:301)
(standard input)-       - locked(a java.lang.Object)
(standard input)-       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
(standard input)-       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"timeoutChecker_1" #48 daemon prio=5 os_prio=0 tid=0x00007fe05163f800 nid=0x56 waiting for monitor entry [0x00007fdf890f4000]
(standard input)-   java.lang.Thread.State: BLOCKED (on object monitor)
(standard input)-       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:187)
(standard input)-       - waiting to lock(a java.util.concurrent.ConcurrentHashMap)
(standard input)-       at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:492)
(standard input)-       at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:432)
(standard input)-       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:403)
(standard input)-       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:389)
(standard input)-       at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1000)
(standard input)-       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:344)
(standard input)-       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:339)
(standard input)-       at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1092)
(standard input):       at io.seata.spring.boot.autoconfigure.util.SpringUtils.getBean(SpringUtils.java:56)
(standard input):       at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:106)
(standard input):       at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:95)
(standard input):       at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$200(SpringBootConfigurationProvider.java:59)
(standard input):       at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:74)
(standard input):       at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig()
(standard input):       at io.seata.core.protocol.ProtocolConstants.(ProtocolConstants.java:79)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequest(AbstractRpcRemoting.java:222)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:197)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemoting.sendAsyncRequestWithResponse(AbstractRpcRemoting.java:179)
(standard input):       at io.seata.core.rpc.netty.NettyPoolableFactory.makeObject(NettyPoolableFactory.java:66)
(standard input):       at io.seata.core.rpc.netty.NettyPoolableFactory.makeObject(NettyPoolableFactory.java:34)
(standard input)-       at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:206)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:103)
(standard input)-       - locked(a java.lang.Object)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:175)
(standard input):       at io.seata.core.rpc.netty.AbstractRpcRemotingClient$1.run(AbstractRpcRemotingClient.java:112)
(standard input)-       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
(standard input)-       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
(standard input)-       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
(standard input)-       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
(standard input)-       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
(standard input)-       at java.lang.Thread.run(Thread.java:745)
(standard input)-
(standard input)-"configOperate_2_2" #47 daemon prio=5 os_prio=0 tid=0x00007fe0516a9800 nid=0x55 waiting on condition [0x00007fdf896f9000]
(standard input)-   java.lang.Thread.State: WAITING (parking)
--
(standard input)-"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007fe05011e800 nid=0x2a in Object.wait() [0x00007fe03c117000]
(standard input)-   java.lang.Thread.State: WAITING (on object monitor)
(standard input)-       at java.lang.Object.wait(Native Method)
(standard input)-       at java.lang.Object.wait(Object.java:502)
(standard input)-       at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
(standard input)-       - locked(a java.lang.ref.Reference$Lock)
(standard input)-       at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)
(standard input)-
(standard input)-"main" #1 prio=5 os_prio=0 tid=0x00007fe05000e800 nid=0x1d waiting for monitor entry [0x00007fe056c6f000]
(standard input)-   java.lang.Thread.State: BLOCKED (on object monitor)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:103)
(standard input)-       - waiting to lock(a java.lang.Object)
(standard input):       at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:175)
(standard input):       at io.seata.core.rpc.netty.RmRpcClient.registerResource(RmRpcClient.java:198)
(standard input):       at io.seata.rm.AbstractResourceManager.registerResource(AbstractResourceManager.java:120)
(standard input):       at io.seata.rm.datasource.DataSourceManager.registerResource(DataSourceManager.java:149)
(standard input):       at io.seata.rm.DefaultResourceManager.registerResource(DefaultResourceManager.java:114)
(standard input):       at io.seata.rm.datasource.DataSourceProxy.init(DataSourceProxy.java:91)
(standard input):       at io.seata.rm.datasource.DataSourceProxy.(DataSourceProxy.java:80)
(standard input):       at io.seata.rm.datasource.DataSourceProxy.(DataSourceProxy.java:69)
(standard input):       at io.seata.spring.annotation.datasource.DataSourceProxyHolder$$Lambda$49/352959830.apply(Unknown Source)
(standard input)-       at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
(standard input)-       - locked(a java.util.concurrent.ConcurrentHashMap$ReservationNode)
(standard input):       at io.seata.spring.annotation.datasource.DataSourceProxyHolder.putDataSource(DataSourceProxyHolder.java:64)
(standard input):       at io.seata.spring.annotation.GlobalTransactionScanner.postProcessAfterInitialization(GlobalTransactionScanner.java:326)
(standard input)-       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:421)
(standard input)-       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1635)
(standard input)-       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
(standard input)-       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
(standard input)-       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
(standard input)-       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
(standard input)-       - locked(a java.util.concurrent.ConcurrentHashMap)
(standard input)-       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
(standard input)-       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
(standard input)-       at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
root@xxxxxxxx:/usr/src/myapp# command terminated with exit code 137
1

评论

  1. 感谢分享

发表评论

电子邮件地址不会被公开。 必填项已用*标注

点击更换