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

Mark Payne commented on NIFI-1487:
----------------------------------

[~ozhurakousky] this is actually by design. There are two annotations that are 
very similar: @OnUnscheduled and @OnStopped. The difference is that 
@OnUnscheduled methods are called whenever the framework stops scheduling the 
processor to run, and @OnStopped is called whenever the processor actually 
finishes. The @OnUnscheduled annotation's main use case is for Processors that 
are fairly long-running to perform a batch operation of some sort, to be 
notified that the user no longer wants the processor to run. This is realized 
by calling isScheduled() (in the AbstractSessionFactoryProcessor). For actions 
such as closing resources, we would want to use @OnStopped.

> Currently @OnUnscheduled operation is invoked before the processor's 
> onTrigger() operation finished execution.
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-1487
>                 URL: https://issues.apache.org/jira/browse/NIFI-1487
>             Project: Apache NiFi
>          Issue Type: Sub-task
>            Reporter: Oleg Zhurakousky
>            Assignee: Oleg Zhurakousky
>             Fix For: 0.6.0
>
>
> While it doesn't appear to have caused major issues yet largely due to the 
> fact that most of the current processors do not implement _@OnUnscheduled_ 
> operation, it could be a problem especially for cases where _onTrigger()_ 
> operation depends on some resources that may be closed/nulled during 
> _@OnUnscheduled_ operation. 
> Will be addressed as part of NIFI-1464



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

Reply via email to