Repository navigation
Fix FanoutRecordsPublisher restartFrom behavior at SHARD_END - #1744
Merged
Merged
Conversation
lucienlu-aws
temporarily deployed
to
manual-approval
May 20, 2026 22:55 — with
GitHub Actions
Inactive
| synchronized (lockObject) { | ||
| // Clear the delivery queue so that any stale entries from previous subscription are discarded. | ||
| resetRecordsDeliveryStateOnSubscriptionOnInit(); | ||
| log.info("ShardId: {}, consumrArn: {}", shardId, consumerArn); |
Contributor
There was a problem hiding this comment.
might want to remove noisy log
Contributor
Author
There was a problem hiding this comment.
Was left over from testing I think, thanks
Comment on lines
+162
to
+164
| ExtendedSequenceNumber continuationSeqNum = | ||
| ((FanoutRecordsRetrieved) recordsRetrieved).continuationSequenceNumber(); | ||
| currentSequenceNumber = continuationSeqNum; |
Contributor
There was a problem hiding this comment.
nit: just assign to currentSequenceNumber directly
| @Accessors(fluent = true) | ||
| @Data | ||
| static class FanoutRecordsRetrieved implements RecordsRetrieved { | ||
| public static class FanoutRecordsRetrieved implements RecordsRetrieved { |
Contributor
There was a problem hiding this comment.
do we need the scope change?
Contributor
Author
There was a problem hiding this comment.
No, put back to protected scope now
lucienlu-aws
had a problem deploying
to
manual-approval
May 28, 2026 16:57 — with
GitHub Actions
Failure
lucienlu-aws
had a problem deploying
to
manual-approval
May 28, 2026 16:59 — with
GitHub Actions
Failure
lucienlu-aws
temporarily deployed
to
manual-approval
May 28, 2026 17:03 — with
GitHub Actions
Inactive
chenylee-aws
approved these changes
May 28, 2026
vincentvilo-aws
pushed a commit
to vincentvilo-aws/amazon-kinesis-client
that referenced
this pull request
Jun 17, 2026
…#1744) * Fix FanoutRecordsPublisher restartFrom behavior at SHARD_END
This branch was previously 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.
Issue #, if available:
Description of changes:
If the FanoutRecordsPublisher reaches the last SubscribeToShardEvent, the
continuationSequenceNumberreturned by the service isnull. This causes an issue if the publisher runs into an error and the ShardConsumerSubscriber callsrestartFromfor the lastAccepted event (ref). The FanoutRecordsPublisher would set the continuationSequenceNumber tonull(ref)causing the subscribeToShard requests to continuously fail where the only remediation would be to force the worker to drop the lease.This commit updates the FanoutRecordsPublisher to handle the SHARD_END event case. If the publisher restartsFrom SHARD_END, it will instead call subscribeToShard with LATEST, which will return the last SHARD_END event from the service and continue the normal SHARD_END tasks through the ShardConsumer and RecordProcessor.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.