NIFI-11 - Capture StringIndexOutOfBoundsException to prevent failed e…#1644
NIFI-11 - Capture StringIndexOutOfBoundsException to prevent failed e…#1644trixpan wants to merge 3 commits intoapache:masterfrom
Conversation
|
@mcgilman - I gave it a try in finding a solution. Happy to adjust in case you think it is needed. Cheers |
|
@trixpan Sorry for the delay, I must have missed the mention on this PR. Evaluating EL can lead to different types of Exceptions depending on the issue with the statement (StringIndexOutOfBounds, NumberFormat, etc). If an onTrigger throws a ProcessException, the flowfile will be penalized and the Processor will NOT be administratively yielded. If any other type of Exception escapes, the flowfile will be penalized and the Process will be administratively yielded. I think the issue in this case is that we are only catching ProcessException. As a result all other Exceptions are escaping and causing the Processor to be yielded. I'm thinking the fix is to simply catch Exception and then rethrow ProcessException to prevent the administrative yielding. Thoughts? |
|
@mcgilman makes total sense. Will adjust |
|
@joewitt Pretty sure it still needs an update. |
|
@mcgilman Hopefully I managed to address your feedback in this last iteration |
|
@trixpan I believe there a couple other instances where we are evaluating an expression where we are still just catching ProcessException. Specifically, I believe we also need this adjustment when evaluating conditions and considering attributes to delete. |
|
@mcgilman indeed. Hopefully the last commit should address the remaining ones. Cheers |
|
@trixpan I think the most recent commit does address the remaining spots, however it appears break a unit test. Do you mind updating? Looking at the failure in the Travis build, I believe the new exception is the desirable behavior. |
|
@mcgilman - Sorry for the delay. rebased and hopefully addressed the jUnit issue |
|
Thanks @trixpan! This has been merged to master. |
…valuations from disrupting flow
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically master)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.