Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

测试网关稳定性时候,出现了异常:/usr/local/apigw/apisix/core/table.lua:108: in function '_deepcopy' #4938

Closed
zhikaichen123 opened this issue Aug 31, 2021 · 3 comments · Fixed by #4952

Comments

@zhikaichen123
Copy link

Issue description

最近在做网关测试,路由里边设置了百度的首页网址,因为百度有做防爬限流所以会报502异常,这个理论上是正常的,问题是运行了一个晚上服务器一直报:
021/08/31 08:41:12 [error] 49#49: *17163909 lua entry thread aborted: runtime error: stack overflow
stack traceback:
coroutine 0:
[C]: in function 'nkeys'
/usr/local/apigw/apisix/core/table.lua:108: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'
..., client: 10.244.4.108, server: _, request: "GET /key/auth?times=46217 HTTP/1.1"

请求这个是什么原因,有什么影响呢,能否修复这个bug?是不是内存没有正常释放呢

附上路由配置:
http://baidu.com

Environment

  • apisix version (cmd: apisix version):
  • OS (cmd: uname -a):
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
  • apisix-dashboard version, if have:
  • luarocks version, if the issue is about installation (cmd: luarocks --version):

Steps to reproduce

如上描述

Actual result

/usr/local/apigw/apisix/core/table.lua:111: in function '_deepcopy'

Error log

如上描述

Expected result

直接返回502,不应该报这个递归的copy异常

@tokers
Copy link
Contributor

tokers commented Aug 31, 2021

What's the version of your APISIX? Please provide more environment information.

@zhikaichen123
Copy link
Author

apisxi 2.6版本,在centos 7 运行,配置是 2C 4G

spacewander added a commit to spacewander/incubator-apisix that referenced this issue Sep 1, 2021
It happened when we are handling upstream with domain inside a route.

Fix apache#4938
Fix apache#4941

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
spacewander added a commit that referenced this issue Sep 2, 2021
It happened when we are handling upstream with domain inside a route.

Fix #4938
Fix #4941

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@zhikaichen123
Copy link
Author

非常感谢 spacewander 的回复,目前我的程序跑了16个小时这样, 再也没有出现之前的table copy问题了,it works!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants