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

feat: new 'db_resurrect_ttl' configuration property + resilient cache callbacks #3579

Merged
merged 5 commits into from
Jun 30, 2018

Conversation

thibaultcha
Copy link
Member

  • Bump mlcache to 2.2.0

This new version adds support for resurrect_ttl, which resurrects
stale values when the callback fails on soft errors.

https://github.com/thibaultcha/lua-resty-mlcache/blob/master/CHANGELOG.md#220

  • add a new 'db_resurrect_ttl' config option

Documentation for its behaviour can be read in the description test
included in kong.conf.default.

  • do not throw error from plugin loader

In order for the resurrection of stale cached values to occur when
callback I/O fails (see c932dc6), we have to return soft errors from our
callbacks, and not throw them via error().

Additionally, we rely on the modern behavior of mlcache with regards to
the caching of cache misses - returning nil is cached my mlcache.

This new version adds support for `resurrect_ttl`, which resurrects
stale values when the callback fails on soft errors.

https://github.com/thibaultcha/lua-resty-mlcache/blob/master/CHANGELOG.md#220
This option is based on
thibaultcha/lua-resty-mlcache#52

Documentation for its behaviour can be read in the description test
included in kong.conf.default.
In order for the resurrection of stale cached values to occur when
callback I/O fails (see c932dc6), we have to return soft errors from our
callbacks, and not throw them via error().
mlcache can cache negative hits (`nil`) values. Historically, this stub
cached value was introduced at a time when the cache solution was a
homegrown utility which did not support negative caching.
This fixes unit tests with mlcache 2.2.0 which relies on the
`get_stale()` shm function.
@thibaultcha thibaultcha merged commit e032ce9 into release/0.14.0 Jun 30, 2018
@thibaultcha thibaultcha deleted the feat/resurrect-ttl branch June 30, 2018 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant