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

Toivo Adams commented on NIFI-1061:
-----------------------------------

Oleg,

Good catch.

Blocking and deadlock is not acceptable of course.

But verification has value in my opinion.
This gives quick feedback is connection parameters correct and at least given 
moment connection can established.
Of course we can’t wait forever. So some kind of timeout mechanism must be used.

1. BasicDataSource itself has method setLoginTimeout but ins’t supported.

2. BasicDataSource has a lot of configuration paramaters but is seems none of 
them are useful for such timeout. 
http://commons.apache.org/proper/commons-dbcp/configuration.html

3. Many database vendors JDBC drivers support some kind of connection timeouts.
But this is not standardized in any way. Such parameters can be added to 
connection string.

4. As Oleg suggested we can implement our own cancellation mechanism using 
Future.

We can currently turn off verification as this solves problem quickly.
And open another jira ticket to implement some sort of timeout.

Currently method getConnection() can also wait forever or very long time.

    @Override
    public Connection getConnection() throws ProcessException {
        try {
            final Connection con = dataSource.getConnection();
            return con;
        } catch (final SQLException e) {
            throw new ProcessException(e);
        }
    }

Thanks
Toivo


> 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