make the method setBackOffFunction work for the batch processing as well#4455
make the method setBackOffFunction work for the batch processing as well#4455LeosBitto wants to merge 4 commits into
Conversation
Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
…cessing (in FallbackBatchErrorHandler) the same way as it does without batch processing (in FailedRecordTracker) Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
|
Hi @LeosBitto, thanks for the PR. I'd like to scope this down to just the How about a minimal version of this PR for the time being?
That way we keep For Also could you add a test that exercises Couple of nits: Found some minor typos in javadoc comments, Please let us know what you think about these. As I am said, I am eager to make these changes into the releases next week, but a bit ambivalent to merge the full change set as it stands right now. Thanks! |
I understand your concerns, and I have started with just just the minimal Of course I could revert my second commit and keep resetStateOnExceptionChange working incorrectly for the batch processing, but I would not like this because I see the current ignoring of resetStateOnExceptionChange for the batch processing to be an obvious bug, which makes using BackOffFunction unreliable. Please let me know whether you really want to keep the current (mis)behaviour of resetStateOnExceptionChange for the batch processing even after I have explained the consequences. |
Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
You are right, such test was missing. I have added it now.
Could you point me to those, please? I will fix them asap. |
|
@LeosBitto Yes, I see your points now. It makes sense to me after hearing your perspectives. I agree that without the reset working, the Thanks for adding the missing test. Couple of things before merge:
Thanks! |
Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
I have fixed the typos and amended whats-new.adoc, so this PR should be ready for merge. Do I understand it correctly that you are afraid of backporting because of changed behavior of |
Wire `FailedRecordTracker` into `FallbackBatchErrorHandler` so that `BackOffFunction` is consulted for batch retries, matching the behavior already in place for single-record processing. Also propagate `setResetStateOnExceptionChange` from `FailedBatchProcessor` to `FallbackBatchErrorHandler` so that a changed exception can start a fresh back-off sequence. The default remains false on the batch path to preserve existing runtime behavior. Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
|
Merged upstream via this commit: 7c9f5c0 The main reason we don't want to backport this to maintenance branches is the new API changes. It wouldn't be fair to users on 3.3.x and 4.0.x suddenly finding the Thanks a lot for the PR and for your patience throughout the review process. |
Wire `FailedRecordTracker` into `FallbackBatchErrorHandler` so that `BackOffFunction` is consulted for batch retries, matching the behavior already in place for single-record processing. Also propagate `setResetStateOnExceptionChange` from `FailedBatchProcessor` to `FallbackBatchErrorHandler` so that a changed exception can start a fresh back-off sequence. The default remains false on the batch path to preserve existing runtime behavior. Fixes: #4455 Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
Wire `FailedRecordTracker` into `FallbackBatchErrorHandler` so that `BackOffFunction` is consulted for batch retries, matching the behavior already in place for single-record processing. Also propagate `setResetStateOnExceptionChange` from `FailedBatchProcessor` to `FallbackBatchErrorHandler` so that a changed exception can start a fresh back-off sequence. The default remains false on the batch path to preserve existing runtime behavior. Fixes: #4455 Signed-off-by: Leos Bitto <leos.bitto@gmail.com>
The method setBackOffFunction of FailedRecordProcessor and its descendants (FailedBatchProcessor and DefaultErrorHandler) is useful for classifying the exceptions thrown from the application code (listeners). However, I find it very surprising that this method does not work when processing the messages in batches (the supplied backOffFunction is never called there). Please review my attempt to make it work for the batch processing as well.