[ 
https://issues.apache.org/jira/browse/NIFI-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997159#comment-14997159
 ] 

Oleg Zhurakousky commented on NIFI-1061:
----------------------------------------

At the core of this issue is that fact that  _DBCPConnectionPool_ attempts to 
test if DB connection could be obtained while executing @OnEnabled operation. 
{code}
final Connection con = dataSource.getConnection();
. . .
con.close();
{code}
The above is naturally a blocking call, and depending on the driver 
implementation could be blocking indefinitely (e.g., with Phoenix driver which 
attempts to retry some 35 times with some delays it could take a while before 
the operation returns). Since this call is executed as part of the synchronized 
block in _StandardProcessScheduler.enableControllerService(..)_ it results in a 
deadlock when attempt is made to disable the service which is in the process of 
being enabled, since it uses the same lock.

While we probably need to address this issue in more general way (e.g., execute 
all @OnEnabled calls as Callable returning a Future that could be canceled), 
IMHO this particular issue should be addressed by removing a connection test 
inside of _DBCPConnectionPool.onConfigured()_, since this test does not provide 
any real values because even if it succeeds, the ability to obtain connection 
could disappear the next second. In other words this operation should return 
once DataSource has been created successfully.

> DBConnectionPool service unable to terminate
> --------------------------------------------
>
>                 Key: NIFI-1061
>                 URL: https://issues.apache.org/jira/browse/NIFI-1061
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Randy Gelhausen
>            Assignee: Oleg Zhurakousky
>             Fix For: 0.4.0
>
>         Attachments: Screen Shot 2015-10-23 at 7.17.31 PM.png, nifi-app.log.gz
>
>
> I had a defined flow with an enabled DBConnectionPool using the 
> phoenix-client.jar driver. After stopping the NiFi process and restarting it, 
> the connection pool is unable to reconnect. Attempting to disable the pool 
> never completes the operation. See attached screenshot & nifi-app.log file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to