I have a setup where I want the user to authenticate for an API. I wrote a plugin for that and it works as expected except for the following scenario:
If the user is authenticated and is cached after the cache expires and the internet is disconnected, a request on the protected route logs the following
[warn] 30#0: *301 [lua] mlcache.lua:763: get(): callback returned an error (failed to call introspection endpoint: [cosocket] DNS resolution failed: dns server error: 3 name error. Tried: ["(short)<API_ENDPOINT>:(na) - cache-miss","<API_ENDPOINT>:33 - cache-miss/scheduled/querying/dns server error: 3 name error","API_ENDPOINT>:1 - cache-miss/scheduled/querying/dns server error: 3 name error","API_ENDPOINT>:5 - cache-miss/scheduled/querying/dns server error: 3 name error"]) but stale value found in shm will be resurrected for 30s (resurrect_ttl), client: 192.168.128.1, server: kong, request: "POST / HTTP/1.1", host: "localhost:3000"
Since the stale value is found in shm and is resurrected, the API call goes through even when it should fail.
Is there a way to:
- Disable the cache resurrection OR
- Remove the stale values from the cache?