Repository navigation
Retry records delivery in shardConsumer - #1822
Merged
Merged
Conversation
chenylee-aws
had a problem deploying
to
manual-approval
October 2, 2026 16:41 — with
GitHub Actions
Failure
lucienlu-aws
reviewed
Oct 6, 2026
chenylee-aws
had a problem deploying
to
manual-approval
October 7, 2026 23:21 — with
GitHub Actions
Failure
chenylee-aws
force-pushed
the
handle_exception
branch
2 times, most recently
from
October 8, 2026 17:44
5afd26c to
014cc2d
Compare
chenylee-aws
had a problem deploying
to
manual-approval
October 8, 2026 17:45 — with
GitHub Actions
Failure
chenylee-aws
force-pushed
the
handle_exception
branch
from
October 8, 2026 17:48
014cc2d to
18d5f85
Compare
chenylee-aws
had a problem deploying
to
manual-approval
October 8, 2026 17:48 — with
GitHub Actions
Failure
chenylee-aws
force-pushed
the
handle_exception
branch
from
October 12, 2026 08:10
18d5f85 to
0483fdc
Compare
chenylee-aws
requested a deployment
to
manual-approval
October 12, 2026 08:10 — with
GitHub Actions
Waiting
chenylee-aws
force-pushed
the
handle_exception
branch
from
October 12, 2026 09:32
0483fdc to
6aaed4a
Compare
chenylee-aws
requested a deployment
to
manual-approval
October 12, 2026 09:32 — with
GitHub Actions
Waiting
lucienlu-aws
approved these changes
Oct 13, 2026
This was referenced Oct 14, 2026
This was referenced Oct 23, 2026
vincentvilo-aws
pushed a commit
to vincentvilo-aws/amazon-kinesis-client
that referenced
this pull request
Oct 26, 2026
chenylee-aws
added a commit
to chenylee-aws/amazon-kinesis-client
that referenced
this pull request
Oct 26, 2026
chenylee-aws
added a commit
that referenced
this pull request
Oct 26, 2026
This was referenced Nov 1, 2026
This branch is waiting to be deployed
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.
Description of changes:
Previously, if anything in KCL's data path threw before a batch was handed to
processRecords(shard lookup, deaggregation, schema decoding, task execution listener, metrics, etc.),ShardConsumerSubscriber.onNextlogged "The incoming data has been skipped" and requested the next batch anyway. The batch was never delivered, and once the application checkpointed a later batch those records were lost for good. Failures insideProcessTaskwere also swallowed and reported as a completed task, and at shard end the exception was discarded entirely.With this change, the handoff to the record processor is the only thing that advances the read position. Every failure in KCL's own handling of a batch now leads to either redelivery or a halted shard consumer with the error surfaced:
ProcessTaskrethrows instead of swallowing, and the subscriber retries the same batch in place with exponential backoff (500 ms to 10 s). Ordering is preserved, because the next batch is not requested until the current one is handed off.lastAcceptedandrequest(1)only advance after a successful handoff.dispatchFailure, whichhealthCheckrethrows on the Scheduler thread, as before.processRecords: unchanged. They are logged and the batch is skipped.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.