[
https://issues.apache.org/jira/browse/NIFI-4028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125482#comment-16125482
]
ASF GitHub Bot commented on NIFI-4028:
--------------------------------------
Github user ijokarumawak commented on the issue:
https://github.com/apache/nifi/pull/2055
Hi @pvillard31 , thanks for tackling this! Although the proposed change can
keep a signal when there are counts remaining, I found that:
- Current implementation of Wait and WaitNotifyProtocal are already
complex, and adding another execution branch would make it more complex, and
hard to maintain
- Calling WaitNotifyProtocol.notify method from Wait is not expected by
design.
So, I'd like to propose different approach, that refactors and consolidates
current implementation so that Wait processor has less different execution
paths in its code. That would be more understandable for developers and users.
Would you take a look at this commit? This branch has 1 more commit based on
this PR:
https://github.com/ijokarumawak/nifi/commit/9bc38bb7ef62a11e0a137b7992eba93b75374453
If it looks reasonable, please add it to your PR.
> Wait processor removes cache regardless of the remaing counter
> --------------------------------------------------------------
>
> Key: NIFI-4028
> URL: https://issues.apache.org/jira/browse/NIFI-4028
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 1.2.0
> Reporter: Koji Kawamura
> Assignee: Pierre Villard
> Attachments: WaitNotify_NIFI-4028.xml
>
>
> Current [Wait processor implementation removes cache
> entry|https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/Wait.java#L438]
> if it's configured with 'Releasable FlowFile Count' is one, when it finds a
> wait signal reaches to 'Target Signal Count' no matter how large the current
> count is.
> This behavior can be problematic, when an user expects the same Signal
> Identifier to be released multiple FlowFiles one by one while multiple counts
> to be accumulated by Notify.
> For example this scenario does not work:
> {code}
> 1. Notify notifies to a 'signal-a' + 1 => 'signal-a' = 1
> 2. Notify notifies to a 'signal-a' again, +1 => 'signal-a' = 2
> 3. Wait releases 1 FlowFile, then remove the 'signal-a' => 'signal-a' is
> removed
> 4. Wait will not be able to release another FlowFile
> {code}
> This should be fixed as follows:
> {code}
> 1. Notify notifies to a 'signal-a' + 1 => 'signal-a' = 1
> 2. Notify notifies to a 'signal-a' again, +1 => 'signal-a' = 2
> 3. Wait releases 1 FlowFile, then update the 'signal-a', -1 => 'signal-a' = 1
> 4. Wait releases another FlowFile, then 'signal-a' becomes 0, remove
> 'signal-a'
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)