Skip to content

NIFI-15916 Log dropped FlowFiles when content is missing#11221

Open
awelless wants to merge 1 commit intoapache:mainfrom
awelless:NIFI-15916-log-dropped-flowfiles
Open

NIFI-15916 Log dropped FlowFiles when content is missing#11221
awelless wants to merge 1 commit intoapache:mainfrom
awelless:NIFI-15916-log-dropped-flowfiles

Conversation

@awelless
Copy link
Copy Markdown
Contributor

@awelless awelless commented May 8, 2026

Summary

NIFI-15916

In handleContentNotFound both branches threw MissingFlowFileException with the same generic "Unable to find content for FlowFile" message, giving operators no FlowFile identity and no way to distinguish an unrecoverable drop from a recoverable rollback.

Registered-claim branch (markForAbort + drop): enrich the exception message with the FlowFile identity and emit a WARN log so the drop is recorded even if the caller swallows the exception.

Transient-claim branch (rollback returns the FlowFile to its queue): enrich the message only - name the in-flight content and signal the session is rolling back so callers can tell this is recoverable.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

In handleContentNotFound both branches threw MissingFlowFileException
with the same generic "Unable to find content for FlowFile" message,
giving operators no FlowFile identity and no way to distinguish an
unrecoverable drop from a recoverable rollback.

Registered-claim branch (markForAbort + drop): enrich the exception
message with the FlowFile identity and emit a WARN log so the drop is
recorded even if the caller swallows the exception.

Transient-claim branch (rollback returns the FlowFile to its queue):
enrich the message only - name the in-flight content and signal the
session is rolling back so callers can tell this is recoverable.
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.

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.

1 participant