You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Pierre Villard (JIRA)" <ji...@apache.org> on 2018/09/24 08:17:00 UTC

[jira] [Updated] (NIFI-5588) Unable to set indefinite max wait time on DBCPConnectionPool

     [ https://issues.apache.org/jira/browse/NIFI-5588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre Villard updated NIFI-5588:
---------------------------------
    Status: Patch Available  (was: Open)

> Unable to set indefinite max wait time on DBCPConnectionPool
> ------------------------------------------------------------
>
>                 Key: NIFI-5588
>                 URL: https://issues.apache.org/jira/browse/NIFI-5588
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.7.1
>         Environment: macOS, Java 8
>            Reporter: Colin Dean
>            Assignee: Pierre Villard
>            Priority: Major
>
> The DBCPConnectionPool controller service accepts a "Max Wait Time" that configures 
> bq. The maximum amount of time that the pool will wait (when there are no available connections) for a connection to be returned before failing, or -1 to wait indefinitely. 
> This value must validate as a time period. *There is no valid way to set {{-1}}* with the current validator.
> The validator [in use|https://github.com/apache/nifi/blob/0274bd4ff3f4199838ff1307c9c01d98fcc9150b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/main/java/org/apache/nifi/dbcp/DBCPConnectionPool.java#L110] is {{StandardValidators.TIME_PERIOD_VALIDATOR}}. The [TIME_PERIOD_VALIDATOR|https://github.com/apache/nifi/blob/0274bd4ff3f4199838ff1307c9c01d98fcc9150b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/processor/util/StandardValidators.java#L443] uses [a regex built  in FormatUtils|https://github.com/apache/nifi/blob/0274bd4ff3f4199838ff1307c9c01d98fcc9150b/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/FormatUtils.java#L44] that must have a time unit:
> {code:java}
> public static final String TIME_DURATION_REGEX = "(\\d+)\\s*(" + VALID_TIME_UNITS + ")";
> {code}
> The regex does not allow for an value such as {{-1}} or {{-1 secs}}, etc.
> The obvious workaround is to set that _very_ high.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)