-
Notifications
You must be signed in to change notification settings - Fork 170
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
[THREESCALE-10130] APIcast using stale configuration for a deleted Product #1488
[THREESCALE-10130] APIcast using stale configuration for a deleted Product #1488
Conversation
1569782
to
03291b5
Compare
@kevprice83 can you also have a look at this PR? Please ignore the CHANGELOG conflict, I will rebase later |
@@ -229,7 +235,7 @@ local function lazy_load_config(configuration, host) | |||
if not config then | |||
ngx.log(ngx.WARN, 'failed to get config for host: ', host) | |||
end | |||
_M.configure(configuration, config) | |||
_M.configure(configuration, config, host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
host
? shouldn't be true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. Lazy mode will not return the stale configuration so we don't really need to clear the cache.
verification steps working as expected |
When reloading the configuration, APIcast only updates the services that present in the new configuration and leaves the old/deleted services in the cache. When a new request is sent to the deleted service, APIcast will reuse the stale configuration in the cache, leading to unexpected behavior. This PR ensures that APIcast always resets the cache when reloading the configuration
03291b5
to
e77139d
Compare
@@ -165,16 +165,18 @@ function _M.store(self, config, ttl) | |||
return config | |||
end | |||
|
|||
function _M.reset(self, cache_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the cache_size is never being used
What
Fix https://issues.redhat.com/browse/THREESCALE-10130
Verification steps
THREESCALE_PORTAL_ENDPOINT=https://<token>@<provider domain>
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 404 Not Found