AWS Certified Developer – Associate — Question 233
A developer is creating an AWS Lambda function to process streaming data from an Amazon Kinesis data stream. When the Lambda function parses the data and encounters a malformed record from the stream, the Lambda function exits with an error.
The developer is observing duplicate records downstream from the function. When the developer uses a different client to examine the Kinesis data stream output, no duplicate records are visible in the stream.
What is the reason for the duplicate records?
Answer options
- A. The Lambda function did not advance the Kinesis data stream pointer to the next record after the error.
- B. The Lambda event source used asynchronous invocation.
- C. The Lambda function did not handle the error, and the Lambda service attempted to reprocess the data.
- D. The Lambda function did not keep up with the amount of data that was coming from the Kinesis data stream.
Correct answer: C
Explanation
The correct answer is C because when the Lambda function encounters an unhandled error, the Lambda service retries processing the same record, leading to duplicates. Option A is incorrect because it does not directly cause duplicates; advancing the pointer would prevent reprocessing. Option B is not relevant here, as asynchronous invocation does not explain the observed behavior. Option D is also wrong since the issue is related to error handling, not the function's processing speed.