-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle append error differently based on ResultBuilder #10191
Conversation
Test Results 852 files ± 0 852 suites ±0 1h 39m 55s ⏱️ + 1m 11s For more details on these failures, see this check. Results for commit 0b9d865. ± Comparison against base commit ab0a90b. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* | ||
* @return returns either a failure or itself for chaining | ||
*/ | ||
Either<RuntimeException, ProcessingResultBuilder> appendRecordReturnEither( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 Suggestion - rename to tryAppendRecord
Return a boolean indicates whether the appending to the TaskResult was successful or not, this allows us to indicate whether the batch is full or not.
Fixes multiple bugs, where we appended records to a batch of records without checking our limits.
3f79291
to
0b9d865
Compare
The test didn't work if the appendRecord returns false (which is per default with mocked instances). Fix the test and add another test to verify that it stops to append.
bors r+ |
Build succeeded: |
10196: Introduce ProcessingResponse r=Zelldon a=Zelldon ## Description blocked by #10191 ✅ blocked by #10188 ✅ Introduce the ProcessingResponse, which encapsulates the information of the Record which should be send as response on a user command and the request- and streamId which identifies the request. The ProcessingResponse usage replaces the usage of the CommandResponseWriter, and deletes several now unused code. <!-- Please explain the changes you made here. --> ## Related issues <!-- Which issues are closed by this PR or are related --> closes #10001 Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
Description
❌ Blocked by #10188
This PR adds Either to the RecordBatch as return value. This allows to handle the error case differently. For example in the Processing right now we want to throw an exception, but later this can also handled differently which is why we added here a separate Method on the ProcessingResultBuilder. This is discussable whether we already want that.
What we need and want is to being able to handle failed appends in the consumers of the ProcessingScheduleService. Means at the TaskResultBuilder we want to now whether it was successful or not and just stop to append more records. This is slightly similar to how we did it before.
This fixes a critical bug #10147
Related issues
closes #10147
related #10001
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.