iterate over non-empty table got empty
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.4k
- Forks
- 252
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 3
Description
The original issue was reported in google group.
i am testing my proxy server by new version of openresty (1.21.4), and i have a big problem
in load test
my nginx config just :worker 1;
and i have some code like this:
rewrite_by_lua_block {
local t = {["1.2.3.4"] = { ["weight"] = 1}, ["4.5.6.7"] = { ["weight"] = 2}}
ngx.ctx.t = t
}
balancer_by_lua_block{
localt = ngx.ctx.t
for key, value in pairs(t) do print(key) end -- output is empty
for key, value in pairs(t) do print(key) end -- have output
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Google Group report and reproduce the issue using the shown rewrite_by_lua_block and balancer_by_lua_block configuration. Compare both pairs iterations over ngx.ctx.t; done means the first iteration no longer produces an empty result or the behavior is clearly documented as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100