Skip to content
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 ets_lru configuration in chttpd application #1655

Merged
merged 1 commit into from Oct 18, 2018

Conversation

@iilyak
Copy link
Contributor

@iilyak iilyak commented Oct 15, 2018

Overview

The code was incorrect in a sense that it was using is_integer guard,
while config:get cannot return integer.

Testing recommendations

  1. Update default.ini to set max_lifetime to 10000
  2. Restart chttpd application
  3. Try manually insert keys into lru_cache and query them. They all should be removed after 10 seconds
lists:foreach(fun(Idx) -> ets_lru:insert(chttpd_auth_cache_lru, Idx, [1,2,3]) end, lists:seq(1, 1000)).
lists:filter(fun(Idx) -> ets_lru:lookup(chttpd_auth_cache_lru, Idx) /= not_found end, lists:seq(1, 1000)).
  1. Try negative value for the setting check logs to make sure it complains
  2. Try putting "some_string" as value check logs to make sure it complains

Related Issues or Pull Requests

N/A

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;
@rnewson
Copy link
Member

@rnewson rnewson commented Oct 16, 2018

the simpler version is to use config:get_integer

@iilyak iilyak force-pushed the cloudant:fix-lru_opts branch from d74124a to a81f488 Oct 16, 2018
@iilyak
Copy link
Contributor Author

@iilyak iilyak commented Oct 16, 2018

@rnewson Updated to use config:get_integer

@iilyak iilyak force-pushed the cloudant:fix-lru_opts branch 4 times, most recently from 7465b14 to 37357b5 Oct 17, 2018
The code was incorect in a sense that it was using is_integer guard,
while `config:get` cannot return integer.
@iilyak iilyak force-pushed the cloudant:fix-lru_opts branch from 37357b5 to 2301cf3 Oct 18, 2018
@iilyak iilyak merged commit e8410d3 into apache:master Oct 18, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@iilyak iilyak deleted the cloudant:fix-lru_opts branch Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants