-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recordTtl = Long.MAX_VALUE causes records to expire immediately & no standard exception message in UserRecordFailedException #54
Comments
Turned out to me a lesser issue. I set Personally I think providing a standard Exception message in UserRecordFailedException helps debugging, but the exception did reveal the cause once I enhanced its handling (thanks to existing code examples):
|
This is an advice, not a comment on the issue itself :) Be careful setting the TTL that long, because the TTL is meant to discard records when your producer is throttled because you are doing so much requests/putting so much data. This throttled records are stored in the daemon using an unbounded buffer. So if you have been throttled and you have this high TTLs the processor will crash because eventually it will run out of memory. So you should assume that in the case of being throttled you may lose some records :( If you expect to hit that you can use multiple shards or, if your records are small enough, use producer aggregation to pack multiple records into one single kinesis record. : |
Thanks for reporting this we'll look into updating the documentation, and the validation to prevent setting the record TTL Long.MAX_VALUE. I agree with @samuelgmartinez on being very careful with large TTLs. |
So, um, what is the largest valid value here? I was just trying to figure this out… The protobuf definition used to transfer this setting says "unsigned 64-bit". That seems to be a lie everyone is willing to live with:
The point at which things seem to go wrong is the arithmetic for expiry. When a message is queued, the time at which the timeout is calculated by adding 'now' to the This bug is a frequent issue with timeout logic. The correct way to handle expiry is:
Steps 2 and 3 are safe from an overflow perspective, assuming time always increases. This is why it's important for expiry logic to also use a monotonically-increasing clock. (I think that means using Coming full circle…
I apologise if I've misunderstood the C++ side of things, but I suspect this is what's going on. |
I'm fairly new to Kinesis and any help is greatly appreciated.
I pretty much followed the code example on AWS to the letter but every single callback fails with a null message. I'm pretty stuck now as I can't find anyone help having similar problems.
I ran the program on both Rackspace Linux and Mac OS X with the same result. I've also tried changing the partition key and the record content without success.
I'm using the latest
0.10.2
and installed using Maven.Included the full stack trace below:
The text was updated successfully, but these errors were encountered: