Skip to content

NIFI-11 - Capture StringIndexOutOfBoundsException to prevent failed e…#1644

Closed
trixpan wants to merge 3 commits intoapache:masterfrom
trixpan:NIFI-11
Closed

NIFI-11 - Capture StringIndexOutOfBoundsException to prevent failed e…#1644
trixpan wants to merge 3 commits intoapache:masterfrom
trixpan:NIFI-11

Conversation

@trixpan
Copy link
Contributor

@trixpan trixpan commented Apr 1, 2017

…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:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • ~~~If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?~~~
  • ~~~If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?~~~
  • ~~~If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?~~~
  • ~~~If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?~~~

For documentation related changes:

  • ~~~Have you ensured that format looks appropriate for the output in which it is rendered?~~~

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.

@trixpan
Copy link
Contributor Author

trixpan commented Apr 1, 2017

@mcgilman - I gave it a try in finding a solution. Happy to adjust in case you think it is needed.

Cheers

@mcgilman
Copy link
Contributor

mcgilman commented Apr 5, 2017

@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?

@trixpan
Copy link
Contributor Author

trixpan commented Apr 25, 2017

@mcgilman makes total sense. Will adjust

@joewitt
Copy link
Contributor

joewitt commented May 24, 2017

@trixpan and @mcgilman is this ready/close or does it need another commit? Could not quite tell from the history if there was a new commit and already squashed or not.

@mcgilman
Copy link
Contributor

mcgilman commented May 24, 2017

@joewitt Pretty sure it still needs an update.

@trixpan
Copy link
Contributor Author

trixpan commented Jun 1, 2017

@mcgilman Hopefully I managed to address your feedback in this last iteration

@mcgilman
Copy link
Contributor

mcgilman commented Jun 2, 2017

@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.

@trixpan
Copy link
Contributor Author

trixpan commented Jun 3, 2017

@mcgilman indeed. Hopefully the last commit should address the remaining ones.

Cheers

@mcgilman
Copy link
Contributor

mcgilman commented Jun 6, 2017

@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.

@trixpan
Copy link
Contributor Author

trixpan commented Jul 18, 2017

@mcgilman - Sorry for the delay.

rebased and hopefully addressed the jUnit issue

@mcgilman
Copy link
Contributor

Thanks @trixpan! This has been merged to master.

@asfgit asfgit closed this in 451a88d Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants