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

ASF GitHub Bot commented on NIFI-1464:
--------------------------------------

Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/275#discussion_r56046482
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/AbstractSchedulingAgent.java
 ---
    @@ -33,6 +42,27 @@
      */
     abstract class AbstractSchedulingAgent implements SchedulingAgent {
     
    +    protected final FlowEngine flowEngine;
    +
    +    protected AbstractSchedulingAgent(FlowEngine flowEngine) {
    +        this.flowEngine = flowEngine;
    +    }
    +
    +    @Override
    +    public <T> T submit(Callable<T> task) throws InterruptedException, 
TimeoutException, ExecutionException {
    +        Future<T> f = flowEngine.submit(task);
    +        String timeoutString = 
NiFiProperties.getInstance().getProperty(NiFiProperties.PROCESSOR_SCHEDULING_TIMEOUT);
    +        long onScheduleTimeout = timeoutString == null ? 60000
    +                : FormatUtils.getTimeDuration(timeoutString.trim(), 
TimeUnit.MILLISECONDS);
    --- End diff --
    
    I think we should wrap this in a try/catch and catch 
IllegalArgumentException, which could get thrown by FormatUtils.getTimeDuration 
if the user makes a typo in the nifi.properties file. If we catch it, we should 
log a warning, I think, and use the default value of 60,000. 


> Refactor lifecycle code for Processors and other components
> -----------------------------------------------------------
>
>                 Key: NIFI-1464
>                 URL: https://issues.apache.org/jira/browse/NIFI-1464
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Oleg Zhurakousky
>            Assignee: Oleg Zhurakousky
>             Fix For: 0.6.0
>
>
> Similar lifecycle handling improvements that went in as part of the NIFI-1164 
> for ControllerServices, could/should be applied to other  components (e..g, 
> Processors).
> The improvements may also help to address NIFI-78 (may be without killing the 
> thread).



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

Reply via email to