Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,27 @@ def get_records(self, shard_iterator: str) -> dict:
)
raise CustomerInvocationError from e
elif "ResourceNotFoundException" in str(e):
LOG.warning(
"Source stream %s does not exist: %s",
# FIXME: The 'Invalid ShardId in ShardIterator' error is returned by DynamoDB-local. Unsure when/why this is returned.
if "Invalid ShardId in ShardIterator" in str(e):
LOG.warning(
"Invalid ShardId in ShardIterator for %s. Re-initializing shards.",
self.source_arn,
)
self.initialize_shards()
else:
LOG.warning(
"Source stream %s does not exist: %s",
self.source_arn,
e,
)
raise CustomerInvocationError from e
elif "TrimmedDataAccessException" in str(e):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you so much for adding this! 🙏 I'll tell the users next week about it for them to confirm to us it solves the issue and they don't need to run the command manually anymore! Thank you very much for going the extra mile here 🙇

LOG.debug(
"Attempted to iterate over trimmed record or expired shard iterator %s for stream %s, re-initializing shards",
shard_iterator,
self.source_arn,
e,
)
raise CustomerInvocationError from e
self.initialize_shards()
else:
LOG.debug("ClientError during get_records for stream %s: %s", self.source_arn, e)
raise PipeInternalError from e
Expand Down
Loading