Closed chenmingchao92 closed 3 months ago
当链接满了以后,抛出的异常如下: 2023-01-10 11:00:05.127 [boundedElastic-122] ERROR o.jetlinks.pro.tdengine.DefaultTDengineRepository - save TDengine data error reactor.core.Exceptions$RetryExhaustedException: Retries exhausted: 3/3 at reactor.core.Exceptions.retryExhausted(Exceptions.java:291) at reactor.util.retry.RetryBackoffSpec.lambda$static$0(RetryBackoffSpec.java:66) at reactor.util.retry.RetryBackoffSpec.lambda$generateCompanion$4(RetryBackoffSpec.java:514) at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:367) at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:243) at reactor.core.publisher.DirectProcessor$DirectInner.onNext(DirectProcessor.java:339) at reactor.core.publisher.DirectProcessor.onNext(DirectProcessor.java:148) at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99) at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onError(FluxRetryWhen.java:180) at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390) at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:185) at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:251) at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onError(FluxOnAssembly.java:390) at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:228) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 10000ms. at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:695) Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Assembly trace from producer [reactor.core.publisher.MonoSubscribeOnCallable] : reactor.core.publisher.Mono.subscribeOn org.jetlinks.pro.tdengine.JdbcTDengineOperations.execute(JdbcTDengineOperations.java:45)
Error has been observed at the following site(s): | Mono.subscribeOn ⇢ at org.jetlinks.pro.tdengine.JdbcTDengineOperations.execute(JdbcTDengineOperations.java:45) | Mono.flatMap ⇢ at org.jetlinks.pro.tdengine.DefaultTDengineRepository.insert(DefaultTDengineRepository.java:621) Stack trace: at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:695) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:197) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:162) at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100) at org.jetlinks.pro.tdengine.JdbcTDengineOperations.doWithConnection(JdbcTDengineOperations.java:31) at org.jetlinks.pro.tdengine.JdbcTDengineOperations.lambda$execute$1(JdbcTDengineOperations.java:40) at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:73) at reactor.core.publisher.MonoRunnable.call(MonoRunnable.java:32) at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:225) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
可以手动close,可以参考demo
我们在java的项目中使用了taos的jdbc 的链接方式来请求taos的数据,然后发现jdbc的链接长时间未释放,最终导致无链接可用。 我们用的taos的服务端和客户端的版本为2.4.0.30。 使用的jdbc的版本为 2.0.38 .想请教一下,taos的jdbc有没有什么配置可以暂缓我这个链接不释放的问题。让我有时间去定位是否是因为业务代码造成的这个问题。我们业务代码用的是 webflux的流式开发。可能会有一些影响。 使用的spring-boot 2.3.4.RELEASE版本。 对应的webflux的spring boot 为:spring-boot-starter-webflux:2.3.4.RELEASE 使用的是jetlinks-pro的iot框架。版本为1.7.0