communication link failure

【详述】
1)查询sr的时候,有时会报communication link failure The last packet successfully received from the server was 10,009 milliseconds ago. The last packet sent successfully to the server was 10,010 milliseconds ago.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure,sr查询超时都已调整过。
企业微信截图_16902553011498
企业微信截图_16902553011498
2)完整日志

SQL: WITH auth_crowds AS (SELECT bitmap_empty()) , crowd_sql AS ( WITH crowd_data AS ( select ‘2023-07-18’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-18 00:00:00’ AND’2023-07-18 23:59:59’ AND pack_id = 7) as seq_id_bitmap union all select ‘2023-07-19’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-19 00:00:00’ AND’2023-07-19 23:59:59’ AND pack_id = 7) as seq_id_bitmap union all select ‘2023-07-20’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-20 00:00:00’ AND’2023-07-20 23:59:59’ AND pack_id = 7) as seq_id_bitmap union all select ‘2023-07-21’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-21 00:00:00’ AND’2023-07-21 23:59:59’ AND pack_id = 7) as seq_id_bitmap union all select ‘2023-07-22’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-22 00:00:00’ AND’2023-07-22 23:59:59’ AND pack_id = 7) as seq_id_bitmap union all select ‘2023-07-23’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-23 00:00:00’ AND’2023-07-23 23:59:59’ AND pack_id = 7) as seq_id_bitmap union all select ‘2023-07-24’ data_date ,(SELECT bitmap_union(seq_id_bitmap) as seq_id_bitmap FROM entity_2_pack_summary WHERE update_time BETWEEN ‘2023-07-24 00:00:00’ AND’2023-07-24 23:59:59’ AND pack_id = 7) as seq_id_bitmap ), black_list AS ( select bitmap_empty() as seq_id_bitmap ) SELECT t.data_date AS dt, bitmap_andnot (t.seq_id_bitmap, b.seq_id_bitmap ) as crowd_bitmap FROM crowd_data t,black_list b ), metric_data AS ( SELECT l.dcdate as dt ,l.custid as user_id ,l.asset_stk as metric_value FROM ifc_dd_label_cust_asset l left join ifc_dd_label_cust_base l1 on l.custid = l1.custid WHERE l.dcdate between ‘2023-07-18 00:00:00’ and ‘2023-07-24 23:59:59’ AND ((l1.gender IN ( ‘2’ )) ) ) ,metric_data_agg as (( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-18’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-18’ AND ‘2023-07-18 23:59:59’) l GROUP BY dt,user_id) UNION ALL ( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-23’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-23’ AND ‘2023-07-23 23:59:59’) l GROUP BY dt,user_id) UNION ALL ( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-22’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-22’ AND ‘2023-07-22 23:59:59’) l GROUP BY dt,user_id) UNION ALL ( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-24’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-24’ AND ‘2023-07-24 23:59:59’) l GROUP BY dt,user_id) UNION ALL ( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-21’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-21’ AND ‘2023-07-21 23:59:59’) l GROUP BY dt,user_id) UNION ALL ( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-20’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-20’ AND ‘2023-07-20 23:59:59’) l GROUP BY dt,user_id) UNION ALL ( SELECT dt,user_id, sum(metric_value) as metric_value FROM ( SELECT ‘2023-07-19’ as dt,user_id,metric_value FROM metric_data WHERE dt BETWEEN ‘2023-07-19’ AND ‘2023-07-19 23:59:59’) l GROUP BY dt,user_id) ) , metric_seq_id_sql as ( select mda.dt,mda.metric_value,sm.seq_id from metric_data_agg mda left join entity_2_seq_id_mapping sm on mda.user_id=sm.entity_id ) ,metric_bitmap_sql AS (SELECT mda.dt, mda.metric_value, bitmap_union(to_bitmap(sm.seq_id)) as seq_id_bitmap FROM metric_data_agg mda LEFT JOIN entity_2_seq_id_mapping sm ON mda.user_id = sm.entity_id GROUP BY mda.dt, mda.metric_value ),base_analysis_result AS (SELECT csf.dt AS dt, bitmap_union(mbs.seq_id_bitmap) AS crowd_bitmap, SUM(IFNULL((metric_value * bitmap_count(bitmap_and(csf.crowd_bitmap,mbs.seq_id_bitmap))),0)) AS metric_value FROM crowd_sql csf INNER JOIN metric_bitmap_sql mbs ON mbs.dt = csf.dt GROUP BY csf.dt ) SELECT dt, metric_value FROM base_analysis_result ORDER BY dt

Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet successfully received from the server was 10,009 milliseconds ago. The last packet sent successfully to the server was 10,010 milliseconds ago.
; Communications link failure

The last packet successfully received from the server was 10,009 milliseconds ago. The last packet sent successfully to the server was 10,010 milliseconds ago.; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet successfully received from the server was 10,009 milliseconds ago. The last packet sent successfully to the server was 10,010 milliseconds ago.
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:100) ~[spring-jdbc-5.3.27.jar!/:5.3.27]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.27.jar!/:5.3.27]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.27.jar!/:5.3.27]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91) ~[mybatis-spring-2.0.7.jar!/:2.0.7]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) ~[mybatis-spring-2.0.7.jar!/:2.0.7]
at com.sun.proxy.$Proxy186.selectList(Unknown Source) ~[?:?]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) ~[mybatis-spring-2.0.7.jar!/:2.0.7]
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166) ~[mybatis-plus-core-3.5.3.1.jar!/:3.5.3.1]
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) ~[mybatis-plus-core-3.5.3.1.jar!/:3.5.3.1]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) ~[mybatis-plus-core-3.5.3.1.jar!/:3.5.3.1]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.3.1.jar!/:3.5.3.1]
at com.sun.proxy.$Proxy276.executeTableDataSql(Unknown Source) ~[?:?]
at com.digitforce.Insight.repository.OlapEventAnalysisNewRepositoryImpl.executeTableDataSql(OlapEventAnalysisNewRepositoryImpl.java:29) ~[Insight-infrastructure-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at com.digitforce.Insight.repository.OlapEventAnalysisNewRepositoryImpl$$FastClassBySpringCGLIB$$c8eb8f4b.invoke() ~[Insight-infrastructure-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137) ~[spring-tx-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) ~[spring-tx-5.3.27.jar!/:5.3.27]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) ~[spring-tx-5.3.27.jar!/:5.3.27]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) ~[spring-tx-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar!/:5.3.27]
at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:50) ~[dynamic-datasource-spring-boot-starter-3.5.2.jar!/:3.5.2]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.27.jar!/:5.3.27]
at com.digitforce.Insight.repository.OlapEventAnalysisNewRepositoryImpl$$EnhancerBySpringCGLIB$$6c0449f7.executeTableDataSql() ~[Insight-infrastructure-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at com.digitforce.Insight.service.impl.EventAnalysisServiceNewImpl.queryTableData(EventAnalysisServiceNewImpl.java:482) ~[Insight-application-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at com.digitforce.Insight.service.impl.EventAnalysisServiceNewImpl.populateAnalysisResult(EventAnalysisServiceNewImpl.java:1217) ~[Insight-application-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at com.digitforce.Insight.service.impl.EventAnalysisServiceNewImpl.analysis(EventAnalysisServiceNewImpl.java:116) ~[Insight-application-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at com.digitforce.Insight.service.impl.EventAnalysisServiceNewImpl$$FastClassBySpringCGLIB$$e772e2a5.invoke() ~[Insight-application-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.27.jar!/:5.3.27]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.27.jar!/:5.3.27]
at com.digitforce.Insight.timeout.AnalysisTimeoutInterceptor.lambda$invoke$0(AnalysisTimeoutInterceptor.java:61) ~[Insight-infrastructure-2.0.1-SNAPSHOT.jar!/:2.0.1-SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_202]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_202]
Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet successfully received from the server was 10,009 milliseconds ago. The last packet sent successfully to the server was 10,010 milliseconds ago.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:916) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at com.mysql.cj.jdbc.ha.MultiHostConnectionProxy$JdbcInterfaceProxy.invoke(MultiHostConnectionProxy.java:107) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.sun.proxy.$Proxy407.execute(Unknown Source) ~[?:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3446) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:434) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3444) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:152) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) ~[druid-1.2.16.jar!/:?]
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy401.execute(Unknown Source) ~[?:?]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80) ~[mybatis-3.5.13.jar!/:3.5.13]
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy400.query(Unknown Source) ~[?:?]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:333) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.3.1.jar!/:3.5.3.1]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy399.query(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.13.jar!/:3.5.13]
at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ~[mybatis-spring-2.0.7.jar!/:2.0.7]
… 39 more
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet successfully received from the server was 10,009 milliseconds ago. The last packet sent successfully to the server was 10,010 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_202]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_202]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_202]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_202]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:581) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:761) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:700) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:1051) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.NativeSession.execSQL(NativeSession.java:665) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:893) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at com.mysql.cj.jdbc.ha.MultiHostConnectionProxy$JdbcInterfaceProxy.invoke(MultiHostConnectionProxy.java:107) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.sun.proxy.$Proxy407.execute(Unknown Source) ~[?:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3446) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:434) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3444) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:152) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) ~[druid-1.2.16.jar!/:?]
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy401.execute(Unknown Source) ~[?:?]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80) ~[mybatis-3.5.13.jar!/:3.5.13]
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy400.query(Unknown Source) ~[?:?]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:333) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.3.1.jar!/:3.5.3.1]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy399.query(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.13.jar!/:3.5.13]
at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ~[mybatis-spring-2.0.7.jar!/:2.0.7]
… 39 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_202]
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[?:1.8.0_202]
at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[?:1.8.0_202]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_202]
at com.mysql.cj.protocol.ReadAheadInputStream.fill(ReadAheadInputStream.java:107) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:150) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.ReadAheadInputStream.read(ReadAheadInputStream.java:180) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at java.io.FilterInputStream.read(FilterInputStream.java:133) ~[?:1.8.0_202]
at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.SimplePacketReader.readHeaderLocal(SimplePacketReader.java:81) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:52) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:41) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:54) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:44) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:575) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:761) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:700) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:1051) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.NativeSession.execSQL(NativeSession.java:665) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:893) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at com.mysql.cj.jdbc.ha.MultiHostConnectionProxy$JdbcInterfaceProxy.invoke(MultiHostConnectionProxy.java:107) ~[mysql-connector-j-8.0.32.jar!/:8.0.32]
at com.sun.proxy.$Proxy407.execute(Unknown Source) ~[?:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3446) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:434) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3444) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:152) ~[druid-1.2.16.jar!/:?]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) ~[druid-1.2.16.jar!/:?]
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:58) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy401.execute(Unknown Source) ~[?:?]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:65) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:80) ~[mybatis-3.5.13.jar!/:3.5.13]
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy400.query(Unknown Source) ~[?:?]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:65) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:333) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:158) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.5.3.1.jar!/:3.5.3.1]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.13.jar!/:3.5.13]
at com.sun.proxy.$Proxy399.query(Unknown Source) ~[?:?]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.13.jar!/:3.5.13]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.13.jar!/:3.5.13]
at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
at
3)为什么应用客户端和sr服务端10s左右会断开连接?下面是我们的连接信息
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
dynamic:
primary: mysql
strict: true
hikari:
idle-timeout: 180000
is-auto-commit: true
max-lifetime: 1800000
connection-timeout: 30000
connection-test-query: SELECT 1
datasource:
mysql:
url: jdbc:mysql://${cd.db.host}:${cd.db.port:3306}/${cd.db.name}?allowMultiQueries=true&useSSL=false&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: ${cd.db.username}
password: ${cd.db.password}
hikari:
min-idle: ${cd.db.connection.min-idle:10}
max-pool-size: ${cd.db.connection.max-active:100}
olap:
url: jdbc:mysql:loadbalance://${starrocks.server-addr}/${starrocks.name}?failOverReadOnly=false
username: ${starrocks.username}
password: ${starrocks.password}
hikari:
min-idle: ${starrocks.connection.min-idle:10}
max-pool-size: ${starrocks.connection.max-active:100}

【StarRocks版本】2.5.6
【集群规模】例如:3fe + 8be(都是32g)
【机器信息】CPU虚拟核/内存/网卡,例如:16C/32G/万兆
【联系方式】1693494150@qq.com

我们生产中也有这个问题,应该是连接池的问题,哥们儿如果解决了的话,麻烦分享一下哈

看连接池,F5,SLB等的超时时间,如果比wait_timeout,query_timeout长就会有这个问题。

检查了,都没超过数据库的配置。

尽量配置成一样的 一般这种问题都是应用方的数据库连接有效期时间,大于数据库自己设置的有效期,show variables like “%timeout%”;可以看到sr的超时时间 链接层面尽量跟sr的超时时间配置成一样,还有一个可能性是mysql服务开启了ssl认证,但这个只会在使用jdbc catalog的时候才会报上面的错

请问你最后是怎么解决的呢?

求问,后面是怎么解决的?

您好。我们用的是slb。【Communications link failure】业务读写StarRocks异常

您好。wait_timeout=28800
query_timeout=300
nginx配置:
server{
listen 8030;
proxy_connect_timeout 10s;
proxy_timeout 300s;
}
问题跟上述一致。