alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.98k stars 8.59k forks source link

[BUG] 连接池(已配置连接检活机制)中连接不能根据数据库server端wait_timeout时间及时清理server端已关闭的长时间未使用的超时连接,导致客户端使用超时连接执行SQL失败报错 #6135

Open zzwgit opened 2 months ago

zzwgit commented 2 months ago

Database Type

MySQL

Database Version

8.0.36

Druid Version

1.2.23

JDK Version

JDK 8

Error SQL

select * from xxxxx

Testcase Code

No response

Stacktrace Info

@ingestionTime 1726552569513 @log 694715958338:/aws/kinesis-analytics/iot-fleet-app-device-ts-data-eu @logStream kinesis-analytics-log-stream @message {"applicationARN":"arn:aws:kinesisanalytics:eu-central-1:694715958338:application/iot-fleet-app-device-ts-data-eu","applicationVersionId":"22","locationInformation":"com.alibaba.druid.pool.DruidDataSource.handleFatalError(DruidDataSource.java:2009)","logger":"com.alibaba.druid.pool.DruidDataSource","message":"{conn-13803} discard","messageSchemaVersion":"1","messageType":"ERROR","threadName":"KeyedProcess -\u003e (Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed) (1/1)#0","throwableInformation":"com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)\n\tat com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)\n\tat com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1429)\n\tat com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1408)\n\tat com.mysql.cj.jdbc.ClientPreparedStatement.checkReadOnlySafeStatement(ClientPreparedStatement.java:309)\n\tat com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:319)\n\tat com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483)\n\tat org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48)\n\tat org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75)\n\tat org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)\n\tat org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)\n\tat org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)\n\tat org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)\n\tat org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141)\n\tat org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)\n\tat com.sun.proxy.$Proxy66.insert(Unknown Source)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.operateDb(SinkToDataTotalToolUsage.java:74)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.doWithRetry(SinkToDataTotalToolUsage.java:55)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:44)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:21)\n\tat org.apache.flink.streaming.api.operators.StreamSink.processElement(StreamSink.java:54)\n\tat org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:82)\n\tat org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:68)\n\tat org.apache.flink.streaming.runtime.tasks.BroadcastingOutputCollector.collect(BroadcastingOutputCollector.java:84)\n\tat org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:62)\n\tat org.apache.flink.streaming.api.operators.KeyedProcessOperator$ContextImpl.output(KeyedProcessOperator.java:129)\n\tat com.chervon.fleet.dashboard.service.statistics.Statistics_DataTotalToolUsage.process(Statistics_DataTotalToolUsage.java:38)\n\tat com.chervon.fleet.dashboard.service.Handler_Statistics.process(Handler_Statistics.java:46)\n\tat com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46)\n\tat com.chervon.fleet.dashboard.service.Handler_ShadowStatus.process(Handler_ShadowStatus.java:70)\n\tat com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46)\n\tat com.chervon.fleet.dashboard.service.Handler_DeviceErrorList.process(Handler_DeviceErrorList.java:77)\n\tat com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46)\n\tat com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:53)\n\tat com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:21)\n\tat org.apache.flink.streaming.api.operators.KeyedProcessOperator.processElement(KeyedProcessOperator.java:83)\n\tat org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:233)\n\tat org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:134)\n\tat org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:105)\n\tat org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)\n\tat org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:519)\n\tat org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:203)\n\tat org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:804)\n\tat org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:753)\n\tat org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953)\n\tat org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:932)\n\tat org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746)\n\tat org.apache.flink.runtime.taskmanager.Task.run(Task.java:568)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)\n\tat com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:593)\n\tat com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:654)\n\tat com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:132)\n\tat com.mysql.cj.NativeSession.sendCommand(NativeSession.java:321)\n\tat com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:1090)\n\tat com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1416)\n\t... 48 more\nCaused by: java.net.SocketException: Broken pipe (Write failed)\n\tat java.base/java.net.SocketOutputStream.socketWrite0(Native Method)\n\tat java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)\n\tat java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)\n\tat java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)\n\tat java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)\n\tat com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55)\n\tat com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50)\n\tat com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:584)\n\t... 53 more\n"} @timestamp 1726552568359 applicationARN arn:aws:kinesisanalytics:eu-central-1:694715958338:application/iot-fleet-app-device-ts-data-eu applicationVersionId 22 locationInformation com.alibaba.druid.pool.DruidDataSource.handleFatalError(DruidDataSource.java:2009) logger com.alibaba.druid.pool.DruidDataSource message {conn-13803} discard messageSchemaVersion 1 messageType ERROR threadName KeyedProcess -> (Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed) (1/1)#0 throwableInformation com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1429) at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1408) at com.mysql.cj.jdbc.ClientPreparedStatement.checkReadOnlySafeStatement(ClientPreparedStatement.java:309) at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:319) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) at com.sun.proxy.$Proxy66.insert(Unknown Source) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.operateDb(SinkToDataTotalToolUsage.java:74) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.doWithRetry(SinkToDataTotalToolUsage.java:55) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:44) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:21) at org.apache.flink.streaming.api.operators.StreamSink.processElement(StreamSink.java:54) at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:82) at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:68) at org.apache.flink.streaming.runtime.tasks.BroadcastingOutputCollector.collect(BroadcastingOutputCollector.java:84) at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:62) at org.apache.flink.streaming.api.operators.KeyedProcessOperator$ContextImpl.output(KeyedProcessOperator.java:129) at com.chervon.fleet.dashboard.service.statistics.Statistics_DataTotalToolUsage.process(Statistics_DataTotalToolUsage.java:38) at com.chervon.fleet.dashboard.service.Handler_Statistics.process(Handler_Statistics.java:46) at com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46) at com.chervon.fleet.dashboard.service.Handler_ShadowStatus.process(Handler_ShadowStatus.java:70) at com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46) at com.chervon.fleet.dashboard.service.Handler_DeviceErrorList.process(Handler_DeviceErrorList.java:77) at com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46) at com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:53) at com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:21) at org.apache.flink.streaming.api.operators.KeyedProcessOperator.processElement(KeyedProcessOperator.java:83) at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:233) at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:134) at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:105) at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65) at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:519) at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:203) at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:804) at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:753) at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953) at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:932) at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746) at org.apache.flink.runtime.taskmanager.Task.run(Task.java:568) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:593) at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:654) at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:132) at com.mysql.cj.NativeSession.sendCommand(NativeSession.java:321) at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:1090) at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1416) ... 48 more Caused by: java.net.SocketException: Broken pipe (Write failed) at java.base/java.net.SocketOutputStream.socketWrite0(Native Method) at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110) at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150) at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55) at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50) at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:584)

Error Info

@ingestionTime 1726552569513 @log 694715958338:/aws/kinesis-analytics/iot-fleet-app-device-ts-data-eu @logStream kinesis-analytics-log-stream @message {"applicationARN":"arn:aws:kinesisanalytics:eu-central-1:694715958338:application/iot-fleet-app-device-ts-data-eu","applicationVersionId":"22","locationInformation":"com.alibaba.druid.pool.DruidDataSource.handleFatalError(DruidDataSource.java:2009)","logger":"com.alibaba.druid.pool.DruidDataSource","message":"{conn-13803} discard","messageSchemaVersion":"1","messageType":"ERROR","threadName":"KeyedProcess -\u003e (Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed) (1/1)#0","throwableInformation":"com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.\n\tat com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)\n\tat com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)\n\tat com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1429)\n\tat com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1408)\n\tat com.mysql.cj.jdbc.ClientPreparedStatement.checkReadOnlySafeStatement(ClientPreparedStatement.java:309)\n\tat com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:319)\n\tat com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483)\n\tat org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48)\n\tat org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75)\n\tat org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)\n\tat org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)\n\tat org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)\n\tat org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)\n\tat org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)\n\tat org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141)\n\tat org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)\n\tat com.sun.proxy.$Proxy66.insert(Unknown Source)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.operateDb(SinkToDataTotalToolUsage.java:74)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.doWithRetry(SinkToDataTotalToolUsage.java:55)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:44)\n\tat com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:21)\n\tat org.apache.flink.streaming.api.operators.StreamSink.processElement(StreamSink.java:54)\n\tat org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:82)\n\tat org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:68)\n\tat org.apache.flink.streaming.runtime.tasks.BroadcastingOutputCollector.collect(BroadcastingOutputCollector.java:84)\n\tat org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:62)\n\tat org.apache.flink.streaming.api.operators.KeyedProcessOperator$ContextImpl.output(KeyedProcessOperator.java:129)\n\tat com.chervon.fleet.dashboard.service.statistics.Statistics_DataTotalToolUsage.process(Statistics_DataTotalToolUsage.java:38)\n\tat com.chervon.fleet.dashboard.service.Handler_Statistics.process(Handler_Statistics.java:46)\n\tat com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46)\n\tat com.chervon.fleet.dashboard.service.Handler_ShadowStatus.process(Handler_ShadowStatus.java:70)\n\tat com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46)\n\tat com.chervon.fleet.dashboard.service.Handler_DeviceErrorList.process(Handler_DeviceErrorList.java:77)\n\tat com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46)\n\tat com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:53)\n\tat com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:21)\n\tat org.apache.flink.streaming.api.operators.KeyedProcessOperator.processElement(KeyedProcessOperator.java:83)\n\tat org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:233)\n\tat org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:134)\n\tat org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:105)\n\tat org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)\n\tat org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:519)\n\tat org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:203)\n\tat org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:804)\n\tat org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:753)\n\tat org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953)\n\tat org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:932)\n\tat org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746)\n\tat org.apache.flink.runtime.taskmanager.Task.run(Task.java:568)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)\n\tat com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)\n\tat com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:593)\n\tat com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:654)\n\tat com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:132)\n\tat com.mysql.cj.NativeSession.sendCommand(NativeSession.java:321)\n\tat com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:1090)\n\tat com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1416)\n\t... 48 more\nCaused by: java.net.SocketException: Broken pipe (Write failed)\n\tat java.base/java.net.SocketOutputStream.socketWrite0(Native Method)\n\tat java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)\n\tat java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)\n\tat java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)\n\tat java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)\n\tat com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55)\n\tat com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50)\n\tat com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:584)\n\t... 53 more\n"} @timestamp 1726552568359 applicationARN arn:aws:kinesisanalytics:eu-central-1:694715958338:application/iot-fleet-app-device-ts-data-eu applicationVersionId 22 locationInformation com.alibaba.druid.pool.DruidDataSource.handleFatalError(DruidDataSource.java:2009) logger com.alibaba.druid.pool.DruidDataSource message {conn-13803} discard messageSchemaVersion 1 messageType ERROR threadName KeyedProcess -> (Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed, Sink: Unnamed) (1/1)#0 throwableInformation com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1429) at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1408) at com.mysql.cj.jdbc.ClientPreparedStatement.checkReadOnlySafeStatement(ClientPreparedStatement.java:309) at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:319) at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:483) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:141) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86) at com.sun.proxy.$Proxy66.insert(Unknown Source) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.operateDb(SinkToDataTotalToolUsage.java:74) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.doWithRetry(SinkToDataTotalToolUsage.java:55) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:44) at com.chervon.fleet.dashboard.sink.SinkToDataTotalToolUsage.invoke(SinkToDataTotalToolUsage.java:21) at org.apache.flink.streaming.api.operators.StreamSink.processElement(StreamSink.java:54) at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:82) at org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:68) at org.apache.flink.streaming.runtime.tasks.BroadcastingOutputCollector.collect(BroadcastingOutputCollector.java:84) at org.apache.flink.streaming.api.operators.CountingOutput.collect(CountingOutput.java:62) at org.apache.flink.streaming.api.operators.KeyedProcessOperator$ContextImpl.output(KeyedProcessOperator.java:129) at com.chervon.fleet.dashboard.service.statistics.Statistics_DataTotalToolUsage.process(Statistics_DataTotalToolUsage.java:38) at com.chervon.fleet.dashboard.service.Handler_Statistics.process(Handler_Statistics.java:46) at com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46) at com.chervon.fleet.dashboard.service.Handler_ShadowStatus.process(Handler_ShadowStatus.java:70) at com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46) at com.chervon.fleet.dashboard.service.Handler_DeviceErrorList.process(Handler_DeviceErrorList.java:77) at com.chervon.fleet.dashboard.service.HandlerManageProcessor.handleReceipt(HandlerManageProcessor.java:46) at com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:53) at com.chervon.fleet.dashboard.job.DeviceShadowProcessFunction.processElement(DeviceShadowProcessFunction.java:21) at org.apache.flink.streaming.api.operators.KeyedProcessOperator.processElement(KeyedProcessOperator.java:83) at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:233) at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.processElement(AbstractStreamTaskNetworkInput.java:134) at org.apache.flink.streaming.runtime.io.AbstractStreamTaskNetworkInput.emitNext(AbstractStreamTaskNetworkInput.java:105) at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65) at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:519) at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:203) at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:804) at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:753) at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953) at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:932) at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746) at org.apache.flink.runtime.taskmanager.Task.run(Task.java:568) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 57,651,208 milliseconds ago. The last packet sent successfully to the server was 57,651,215 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:593) at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:654) at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:132) at com.mysql.cj.NativeSession.sendCommand(NativeSession.java:321) at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:1090) at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1416) ... 48 more Caused by: java.net.SocketException: Broken pipe (Write failed) at java.base/java.net.SocketOutputStream.socketWrite0(Native Method) at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110) at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150) at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55) at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50) at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:584)

BelowShadow commented 3 weeks ago

keepalive配置成=true试试呢

BelowShadow commented 3 weeks ago

你发现你现在的druid配置我看下

zzwgit commented 3 weeks ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我现在有事,无法亲自回复您的邮件。我将在结束后,尽快给您回复。