Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3751,13 +3751,14 @@ private void handleContentNotFound(final ContentNotFoundException nfe, final Sta

if (missingClaim == registeredClaim) {
suspectRecord.markForAbort();
LOG.warn("Unable to find content for {}; dropping FlowFile", suspectRecord.getCurrent(), nfe);
rollback();
throw new MissingFlowFileException("Unable to find content for FlowFile", nfe);
throw new MissingFlowFileException("Unable to find content for " + suspectRecord.getCurrent() + "; dropping FlowFile", nfe);
}

if (missingClaim == transientClaim) {
rollback();
throw new MissingFlowFileException("Unable to find content for FlowFile", nfe);
throw new MissingFlowFileException("Unable to find in-flight content for " + suspectRecord.getCurrent() + "; rolling back", nfe);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,10 @@ public void testMissingFlowFileExceptionThrownWhenUnableToReadData() {

// attempt to read the data.
final FlowFile ff1 = session.get();
assertThrows(MissingFlowFileException.class, () -> session.read(ff1, InputStream::read));
final MissingFlowFileException ex = assertThrows(MissingFlowFileException.class,
() -> session.read(ff1, InputStream::read));
assertTrue(ex.getMessage().contains("12345678-1234-1234-1234-123456789012"));
assertTrue(ex.getMessage().contains("rolling back"));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general asserting exception messages is a questionable practice. But since this change is focusing on the messages in particular, I wanted to ensure the change is covered.

Let me know if you see it redundant.

}

@Test
Expand Down Expand Up @@ -1775,7 +1778,10 @@ public void testContentNotFoundExceptionThrownWhenUnableToReadDataOffsetTooLarge
session.get();
final FlowFile ff2 = session.get();

assertThrows(MissingFlowFileException.class, () -> session.read(ff2, InputStream::read));
final MissingFlowFileException ex = assertThrows(MissingFlowFileException.class,
() -> session.read(ff2, InputStream::read));
assertTrue(ex.getMessage().contains("12345678-1234-1234-1234-123456789012"));
assertTrue(ex.getMessage().contains("rolling back"));
}

@Test
Expand Down
Loading