[
https://issues.apache.org/jira/browse/NIFI-4559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16227313#comment-16227313
]
Matt Burgess commented on NIFI-4559:
------------------------------------
I see a couple of scenarios here:
1) If we're guaranteed that non-zero exit codes always mean failure, we could
add a "failure" relationship and penalize all flow files whose execution status
code is non-zero.
2) If that's not guaranteed, we could have a "non-zero status" relationship,
and add a property allowing the user to configure whether or not flow files
transferred to this relationship should be penalized.
#1 has an easier user experience for configuration (consistent relationship
name, no new properties), but changes the existing behavior of the processor
(some flow files that had not been penalized will now be penalized).
#2 changes the configuration aspect (custom relationship, additional property),
but preserves backwards compatibility. Using a default setting of "false" for
whether to penalize flow files, the user would only have to send the "non-zero
status" relationship to the same downstream processor as the "success"
relationship in order to maintain existing behavior.
For the overall use case, the user can now send the flow files to a separate
flow for processing, versus the previous pattern of ExecuteStreamCommand ->
RouteOnAttribute (checking execution.status.code for zero) -> ControlRate (to
penalize)
My preference is for #2, but like I said, if all non-zero codes mean failure on
all OSes and programs, then I'm fine with the simpler approach.
> ExecuteStreamCommand should have a failure relationship
> -------------------------------------------------------
>
> Key: NIFI-4559
> URL: https://issues.apache.org/jira/browse/NIFI-4559
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Affects Versions: 1.4.0
> Reporter: Joseph Witt
>
> ExecuteStreamCommand only has a success relationship. The gist is it
> executes the command, captures the output stream, code, etc.. and stores the
> necessary content and attributes.
> However, for those wanting to see the status code as an indicator of failure
> they have to create a flow which checks, loops, etc.. This is more work than
> necessary since the processor can provide a better indicator. By adding a
> failure relationship we can route results and status codes for non-zero to
> this relationship. We'll have to consider backward compatibility friendly
> ideas but the gist is to make this common failure/retry pattern easier to
> configure and track.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)