NIFI-6367 - more error handling for FetchS3Object#3563
Conversation
joewitt
reviewed
Aug 28, 2019
| final Map<String, String> attributes = new HashMap<>(); | ||
| try (final S3Object s3Object = client.getObject(request)) { | ||
| if (s3Object == null) { | ||
| throw new IOException("AWS refused to execute this request."); |
Contributor
There was a problem hiding this comment.
as a general rule intentionally throwing this to simple catch it below is really just using exceptions for flow control which isn't awesome as it does have a pretty significant impact on the performance of the jvm during stack generation. that said this is something we can improve it becomes a real problem and it isn't like we're perfect in this regard elsehwere
Contributor
|
+1 merged to master. thanks |
szaboferee
pushed a commit
to szaboferee/nifi
that referenced
this pull request
Oct 7, 2019
…bject Signed-off-by: Joe Witt <joewitt@apache.org>
patricker
pushed a commit
to patricker/nifi
that referenced
this pull request
Jan 22, 2020
…bject Signed-off-by: Joe Witt <joewitt@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some circumstances FetchS3Processor will penalize the flowfile instead of failing it, and can get into a loop where it continually tries to process the flowfile and never succeeds or fails.
This simply adds some error handling checks to avoid that.