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

fix LfuCache ttl can be equal to tti #2188

Merged
merged 2 commits into from Oct 2, 2018

Conversation

Projects
None yet
5 participants
@tg44
Copy link
Contributor

tg44 commented Sep 4, 2018

If you don't want to use tti you need to write some ugly time-to-idle = 5 minutes - 1 seconds to the config. So I fixed the requirement.

(Maybe if tti is not finite we should use ttl for both values. That would make easier setup in some use-cases. But that can be misleading too, so I did the minimal effort "fix" only.)

(Or maybe we should play with boolalgebra and change the whole thing to:
!(timeToLive.isFinite && timeToIdle.isFinite && timeToLive < timeToIdle) bcs the following implementation only set the desired finite values...)

@akka-ci

This comment has been minimized.

Copy link
Collaborator

akka-ci commented Sep 4, 2018

Thank you for your pull request! After a quick sanity check one of the team will reply with 'OK TO TEST' to kick off our automated validation on Jenkins. This compiles the project, runs the tests, and checks for things like binary compatibility and source code formatting. When two team members have also manually reviewed and (perhaps after asking for some amendments) accepted your contribution, it should be good to be merged.

For more details about our contributing process, check out CONTRIBUTING.md - and feel free to ask!

@jrudolph

This comment has been minimized.

Copy link
Member

jrudolph commented Sep 4, 2018

OK TO TEST

@akka-ci akka-ci added validating tested and removed validating labels Sep 4, 2018

@akka-ci

This comment has been minimized.

Copy link
Collaborator

akka-ci commented Sep 4, 2018

Test PASSed.

@raboof

raboof approved these changes Oct 1, 2018

Copy link
Member

raboof left a comment

Seems convenient to me

@jonas

This comment has been minimized.

Copy link
Member

jonas commented Oct 1, 2018

The documentation currently states:

Time-based entry expiration is enabled when a time-to-live and/or time-to-idle
expirations are set to a finite duration. The former provides an
upper limit to the time period an entry is allowed to remain in the cache while
the latter limits the maximum time an entry is kept without having been
accessed, ie. either read or updated. If both values are finite the time-to-live
has to be strictly greater than the time-to-idle.

Please update it to reflect the change by removing the last sentence.

Otherwise, I don't remember the motivation for TTL > TTI, so looks good to me.

@jrudolph
Copy link
Member

jrudolph left a comment

LGTM

@akka-ci

This comment has been minimized.

Copy link
Collaborator

akka-ci commented Oct 2, 2018

Test PASSed.

@jrudolph jrudolph merged commit abc4704 into akka:master Oct 2, 2018

3 checks passed

Jenkins PR Validation Test PASSed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
typesafe-cla-validator All users have signed the CLA
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment