无法获得连接,池错误超时等待 PutSQL 中的空闲对象? [英] Cannot get a connection, pool error Timeout waiting for idle object in PutSQL?

查看:26
本文介绍了无法获得连接,池错误超时等待 PutSQL 中的空闲对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 PutSQL 处理器的并发任务增加到10".

当时它显示以下错误但没有数据丢失.

由于 org.apache.nifi.processor.exception.ProcessException 导致处理失败:org.apache.commons.dbcp.SQLNestedException:无法获得连接,池错误超时等待空闲对象;回滚会话:

如果我删除了并发任务,那么它就可以正常工作了

虽然谷歌这个例外,我在下面的链接中找到了答案

它可能会解决您的问题.

I have increased the concurrent tasks to be '10' for PutSQL processor.

At that time it shows below error but there is no data loss.

failed to process due to org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object; rolling back session: 

if i have remove concurrent tasks then it worked without those exception

while google this exception i have found answer in below link

I am getting Cannot get a connection, pool error Timeout waiting for idle object, When I try to create more than 250 threads in my web application

But i don't know how to avoid this issue in NiFi putSQL.

Can anyone help me to resolve this?

解决方案

This exception occurs when the pool manager cannot produce a viable connection to a waiting requester and the maxWait has passed therefore triggering a timeout. There are several causes, but they usually fall into 2 main categories:

  • The DB is down or unreachable.
  • The connection pool (which is set to 100 max active) is out of connections.

DBCPConnectionPool controller service in nifi has 8 max connection by default and 500 milli seconds max wait time. When PutSQL processor occupied 8 connection from DBCP pool and when it request for 9th connection or exceed the max connection limit then it will throw "Cannot get a connection" exception.

You can try 2 things to avoid this Exception :

  1. You can increase the "Max Wait Time" in DBCPConnectionPool controller
    service configuration.
  2. You can increase the "Max Total Connections" limit in DBCPConnectionPool controller service configuration.

Kindly find the below screenshot where you need to do changes.

It might resolve your issue.

这篇关于无法获得连接,池错误超时等待 PutSQL 中的空闲对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆