You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/03/04 15:51:20 UTC

[GitHub] [shardingsphere] duanzonglong opened a new issue #9594: marked as broken because of SQLSTATE(08S01),

duanzonglong opened a new issue #9594:
URL: https://github.com/apache/shardingsphere/issues/9594


   ## Bug Report
   
   sharding proxy warn log
   
   [2021-03-04 19:21:31.827] [ShardingSphere-Command-4] [WARN ] com.zaxxer.hikari.pool.ProxyConnection - HikariPool-3 - Connection com.mysql.jdbc.JDBC4Connection@5bcd93ee marked as broken because of SQLSTATE(08S01), ErrorCode(0)
   com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
           at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
           at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
           at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3562)
           at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3462)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3903)
           at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
           at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
           at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2482)
           at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2440)
           at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
           at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:939)
           at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:103)
           at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.executeSQL(StatementExecutorWrapper.java:130)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.execute.callback.ProxySQLExecuteCallback.executeSQL(ProxySQLExecuteCallback.java:82)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.execute.callback.ProxySQLExecuteCallback.executeSQL(ProxySQLExecuteCallback.java:77)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.execute.callback.ProxySQLExecuteCallback.executeSQL(ProxySQLExecuteCallback.java:46)
           at org.apache.shardingsphere.sharding.execute.sql.execute.SQLExecuteCallback.execute0(SQLExecuteCallback.java:82)
           at org.apache.shardingsphere.sharding.execute.sql.execute.SQLExecuteCallback.execute(SQLExecuteCallback.java:58)
           at org.apache.shardingsphere.underlying.executor.engine.ExecutorEngine.syncExecute(ExecutorEngine.java:97)
           at org.apache.shardingsphere.underlying.executor.engine.ExecutorEngine.serialExecute(ExecutorEngine.java:82)
           at org.apache.shardingsphere.underlying.executor.engine.ExecutorEngine.execute(ExecutorEngine.java:76)
           at org.apache.shardingsphere.sharding.execute.sql.execute.SQLExecuteTemplate.execute(SQLExecuteTemplate.java:68)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.execute.JDBCExecuteEngine.execute(JDBCExecuteEngine.java:80)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:89)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:75)
           at org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.execute(QueryBackendHandler.java:52)
           at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:78)
           at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:93)
           at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
           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)
   Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
           at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:3014)
           at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3472)
           ... 30 common frames omitted
   [2021-03-04 19:21:31.831] [epollEventLoopGroup-3-1] [WARN ] io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
   java.sql.SQLException: null
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.connection.BackendConnection.throwSQLExceptionIfNecessary(BackendConnection.java:303)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.connection.BackendConnection.close(BackendConnection.java:253)
           at org.apache.shardingsphere.shardingproxy.frontend.netty.FrontendChannelInboundHandler.channelInactive(FrontendChannelInboundHandler.java:84)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
           at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:393)
           at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:358)
           at io.netty.handler.codec.ByteToMessageCodec.channelInactive(ByteToMessageCodec.java:118)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
           at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236)
           at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1417)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257)
           at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243)
           at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:913)
           at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819)
           at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
           at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
           at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:388)
           at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
           at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
           at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
           at java.lang.Thread.run(Thread.java:745)
   
   my app run error
   2021-03-04 19:21:31.838 [http-nio-8511-exec-80] [trace-id=2b97225e428a73a] [span-id=c1d103c2b2f7212f] [tenant=36] [user=3702e4e1bec249c4b57dff7466d5bbf6] WARN  com.zaxxer.hikari.pool.ProxyConnection:182 - DatebookHikariCP - Connection com.mysql.jdbc.JDBC4Connection@71ff06e9 marked as broken because of SQLSTATE(08S01), ErrorCode(0)
   com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
           at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
           at com.mysql.jdbc.Util.getInstance(Util.java:408)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
           at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
           at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
           at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
           at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
           at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)
           at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
           at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
           at io.opentracing.contrib.jdbc.TracingPreparedStatement.execute(TracingPreparedStatement.java:206)
           at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)
           at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
           at sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
           at com.sun.proxy.$Proxy404.query(Unknown Source)
           at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
           at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:326)
           at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
           at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
           at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:143)
           at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
           at com.sun.proxy.$Proxy403.query(Unknown Source)
           at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
           at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
           at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
           at com.sun.proxy.$Proxy159.selectList(Unknown Source)
           at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
           at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:139)
           at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:76)
           at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
           at com.sun.proxy.$Proxy189.selectByExample(Unknown Source)
           at sun.reflect.GeneratedMethodAccessor214.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
           at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:55)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
           at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
           at com.saascloud.scms.wms.config.MapperAspect.doAround(MapperAspect.java:46)
           at sun.reflect.GeneratedMethodAccessor168.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:644)
           at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
           at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
           at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
           at com.sun.proxy.$Proxy190.selectByExample(Unknown Source)
           at com.saascloud.common.core.biz.BaseBiz.selectByExample(BaseBiz.java:89)
           at com.saascloud.common.core.biz.BaseBiz$$FastClassBySpringCGLIB$$8d523b75.invoke(<generated>)
           at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
           at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
           at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
   
   version:
   shardingproxy 4.1.0
   code:
     wms_sd0:
       url: jdbc:mysql://172.16.64.143:3306/wms_sd0?useUnicode=true&characterEncoding=UTF8&useSSL=false
       username: root
       password: xxxx
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 120000
       maxPoolSize: 65
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
     wms_sd1:
       url: jdbc:mysql://172.16.64.143:3306/wms_sd1?useUnicode=true&characterEncoding=UTF8&useSSL=false
       username: root
       password: xxxx
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 120000
       maxPoolSize: 65
       minPoolSize: 1
       maintenanceIntervalMilliseconds: 30000
   springboot config:
   # 数据库驱动名
   spring.datasource.driver-class-name=com.mysql.jdbc.Driver
   # 数据库连接池类型
   spring.datasource.type=com.zaxxer.hikari.HikariDataSource
   # 池中维护的最小空闲连接数
   spring.datasource.hikari.minimum-idle=5
   # 池中最大连接数,包括闲置和使用中的连接 如果maxPoolSize小于1,则会被重置。当minIdle<=0被重置为DEFAULT_POOL_SIZE则为10;如果minIdle>0则重置为minIdle的值
   spring.datasource.hikari.maximum-pool-size=15
   # 自动提交从池中返回的连接
   spring.datasource.hikari.auto-commit=true
   # 连接允许在池中闲置的最长时间
   spring.datasource.hikari.idle-timeout=30000
   # 连接池的用户定义名称,主要出现在日志记录和JMX管理控制台中以识别池和池配置
   spring.datasource.hikari.pool-name=DatebookHikariCP
   # 池中连接最长生命周期 如果不等于0且小于30秒则会被重置回30分钟
   spring.datasource.hikari.max-lifetime=1800000
   # 等待来自池的连接的最大毫秒数 如果小于250毫秒,则被重置回30秒
   spring.datasource.hikari.connection-timeout=30000
   # 连接健康测试的sql
   spring.datasource.hikari.connection-test-query=SELECT 1
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] yu199195 commented on issue #9594: marked as broken because of SQLSTATE(08S01),

Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #9594:
URL: https://github.com/apache/shardingsphere/issues/9594#issuecomment-791285191


   connectionTimeout , the connection will close.
   1. you should check why  time out?
   2. have slow query?
   3. a transaction lock?  or otherlock?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] duanzonglong closed issue #9594: marked as broken because of SQLSTATE(08S01),

Posted by GitBox <gi...@apache.org>.
duanzonglong closed issue #9594:
URL: https://github.com/apache/shardingsphere/issues/9594


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org