aws-sdk-cpp
aws-sdk-cpp copied to clipboard
Kinesis enhanced fanout latency issue.
Describe the bug
When using aws-sdk-cpp to subscribe to a Kinesis stream with enhanced fanout via the SubscribeToShard() method, the SetEventStreamHandler() callback is invoked with noticeable delays, and data is received in batches instead of real-time. This causes inefficient processing of the stream data, leading to potential performance issues, especially in low-latency or real-time systems.stream data processing
Expected Behavior
- The SetEventStreamHandler() should be invoked in near real-time as soon as new records are available in the Kinesis stream.
- Records should be delivered individually or as soon as they are available without being unnecessarily batched or delayed.
Current Behavior
- The SetEventStreamHandler() callback is delayed and not invoked immediately when new records arrive in the Kinesis shard.
- Data is accumulated in batches and delivered with noticeable delays rather than being processed as soon as records are produced in the stream.
Reproduction Steps
- Use aws-sdk-cpp to create a Kinesis enhanced fanout consumer.
- Set up the SubscribeToShard() method with enhanced fanout and set the event handler using SetEventStreamHandler() to process incoming records.
- Write a simple record producer that sends data to the Kinesis stream.
- Observe that the SetEventStreamHandler() callback is invoked with delays and receives records in batches rather than as they become available
Possible Solution
No response
Additional Information/Context
- The problem persists regardless of the producer's rate of sending records to the stream.
- Slower the producer, higher the delays are (155 seconds delay if producer sends a single record)
- Also mentioned in discussion Kinesis enhanced fanout latency issuethe
AWS CPP SDK version used
1.11.389
Compiler and Version used
gcc 11.4.0
Operating System and version
Ubuntu 22.04
Can you provide a minimal reproduction sample that follows the steps you listed above?
I've attached the consumer code. This code does not throw any exception or set any error in subscribeOutcome. Its just that the handler is invoked with significant delay which is explained above. Producer is pretty straightforward which works fine with other consumers.
@jmklix Any updates on this. And do let me know if you need anything else.
Are there any updates on this?
We are still looking into this. We're not entirely sure, but this appears to be an issue with the Kinesis service taking a while to respond rather than a delay caused by the sdk. I will provide more updates here when I find out more info.
We are working on a PR that might fix this. I will link it here when we have it working
Fix has been provided via https://github.com/aws/aws-sdk-cpp/pull/3245. Waiting for customer feedback
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Hello, Thank you for providing the fix, let me confirm and update you here.