MINIFICPP-2731 Allow cancellation from ProcessSession::write#2120
Open
martinzink wants to merge 4 commits intoapache:mainfrom
Open
MINIFICPP-2731 Allow cancellation from ProcessSession::write#2120martinzink wants to merge 4 commits intoapache:mainfrom
martinzink wants to merge 4 commits intoapache:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Enables a processor to cancel an in-progress ProcessSession::write operation (e.g., while streaming) without committing the newly written content, by signaling cancellation from the write callback and discarding the temporary ResourceClaim.
Changes:
- Added
ContentSession::remove(...)to allow abandoning newly created/managedResourceClaims. - Introduced a C API status enum (
MinifiIoStatus) with a cancellation code. - Updated
ProcessSessionImpl::writeto detect cancellation from the callback and discard the new claim instead of overwriting the FlowFile’s content.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| minifi-api/include/minifi-cpp/core/ContentSession.h | Adds remove(...) to the content session interface. |
| minifi-api/include/minifi-c/minifi-c.h | Adds MinifiIoStatus with a cancel status value. |
| libminifi/src/core/ProcessSession.cpp | Implements cancellation handling in write(...) based on callback return value. |
| libminifi/src/core/ForwardingContentSession.cpp | Implements remove(...) by dropping claim/session bookkeeping. |
| libminifi/include/core/ForwardingContentSession.h | Declares the new remove(...) override. |
| core-framework/src/core/BufferedContentSession.cpp | Implements remove(...) to discard buffered state for a claim. |
| core-framework/include/core/BufferedContentSession.h | Declares the new remove(...) override. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2321ae3 to
97d1072
Compare
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.
This is required to support fluid streaming api.
Currently if we opened the OutputStream it will always replace the old content, but lets say a processor wants to process flowfile content as a stream (read current content and write the new content at the same time), but if something comes up it might want to drop all changes and route the FlowFile to failure.
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
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 MINIFICPP-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 main)?
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 GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.