Comments (11)
i don't known how to reproduce this issue yet. I also found this problem by accident.
from apisix-go-plugin-runner.
@envestcc
Does #44 solve the problem?
from apisix-go-plugin-runner.
i don't known how to reproduce this issue yet. I also found this problem by accident.
the log is here:
2021/10/09 10:49:49 [warn] 6123#6123: *13162642 [lua] init.lua:361: get conf token: 1 conf: [{"value":"","name":"auth_check"}], client: 10.192.233.18, server: _, request: "GET /welcome HTTP/1.1", host: ""
2021/10/09 10:49:49 [warn] 6126#6126: *343 [lua] init.lua:683: 2021-10-09T10:49:49.431+0800 INFO server/server.go:121 receive rpc type: 2 data length: 896
, context: ngx.timer
2021/10/09 10:49:49 [warn] 6126#6126: *343 [lua] init.lua:683: 2021-10-09T10:49:49.431+0800 WARN plugin/conf.go:132 get conf with token 1
2021-10-09T10:49:49.431+0800 WARN server/server.go:59 key not found
, context: ngx.timer
from apisix-go-plugin-runner.
No, "key not found" is still shown.
btw, where can i set or see the token expire time in apisix ?
from apisix-go-plugin-runner.
from apisix-go-plugin-runner.
Any other ideas?
from apisix-go-plugin-runner.
Err, we need a way to reproduce it so that we can locate it. Can you find a way to reproduce it?
from apisix-go-plugin-runner.
lrucache should be set invalid_stale = true
?
local events_list
local lrucache = core.lrucache.new({
type = "plugin",
ttl = helper.get_conf_token_cache_time(),
})
local function new_lru_fun(opts)
...
local item_release = opts and opts.release
local invalid_stale = opts and opts.invalid_stale -- false
local serial_creating = opts and opts.serial_creating
local lru_obj = lru_new(item_count)
return function (key, version, create_obj_fun, ...)
if not serial_creating or not can_yield_phases[get_phase()] then
local cache_obj = fetch_valid_cache(lru_obj, invalid_stale,
item_ttl, item_release, key, version)
if cache_obj then
return cache_obj.val
end
.....
local function fetch_valid_cache(lru_obj, invalid_stale, item_ttl,
item_release, key, version)
local obj, stale_obj = lru_obj:get(key)
if obj and obj.ver == version then
return obj
end
-- get an expired key in lrucachd that could not find in go runner
if not invalid_stale and stale_obj and stale_obj.ver == version then
lru_obj:set(key, stale_obj, item_ttl)
return stale_obj
end
if item_release and obj then
item_release(obj.val)
end
return nil
end
from apisix-go-plugin-runner.
@zdzh
You are correct! Would you submit a fix to APISIX?
from apisix-go-plugin-runner.
Fixed by apache/apisix#5309
from apisix-go-plugin-runner.
apache/apisix#5782
Fix this issue more thoroughly. When the token key in the cache doesn't match the conf in the runner (probably in the dev mode, after people restart the runner), a new lrucache will be created. This lrucache hasn't invalid stale cache until this PR fixes it.
from apisix-go-plugin-runner.
Related Issues (20)
- 通过ext-plugin-pre-req插件为什么不能修改请求body。迫切的需要呀。apisix-go-plugin-runner
- how to use ext-plugin-pre-req change apisix request body。 base on apisix-go-plugin-runner
- request help: The plugin is registered, but cannot be viewed through v1/schema HOT 4
- request help: The ext-plugin-post-resp is not working properly HOT 1
- 插件中写了读取了req.Body(), 当body内容大于100多KB的时候,nginx worker内存会持续上升
- request help: how to rewrite request body? HOT 2
- request help: request id 和 通过 response 取的 request id 不一样 ,是否有什么规则? HOT 5
- 请求帮助:我需要将response与对应的request关联起来
- close
- request help: support get cookies method in request interface
- request help: I found the ext-plugin-post-resp will not execute if write response on ext-plugin-pre-req, is there any way to let ext-plugin-post-resp execute in this case?
- 当前5.0版本Go Plugin在最新的apisix:3.6.0上无法运行
- ext-plugin-post-resp processing content-type have problem HOT 1
- request help: How to get the cert and cacert from the plugin request
- request help: Need to rewrite the http request method HOT 3
- bug: Logging using `pkg/log` does not work
- request help: APISIX 无法正确启动go-runner HOT 2
- request help: How to get pkgHTTP.Request in ResponseFilter? HOT 2
- bug: request body rewrite cannot automatically modify content-length request header.
- request help: Request header modification sometimes does not take effect in ext-plugin-pre-req
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apisix-go-plugin-runner.