bug: the latest version of the skywalking plugin always outputs error log
Issue description
I pulled the latest code and found a persistent error level output in the logs/error.log
2020/11/04 14:54:50 [error] 20481#20481: *28563 [lua] client.lua:92: reportServiceInstance(): Instance report fails, connection refused, context: ngx.timer
2020/11/04 14:54:53 [error] 20481#20481: *28739 [lua] client.lua:92: reportServiceInstance(): Instance report fails, connection refused, context: ngx.timer
2020/11/04 14:54:56 [error] 20481#20481: *28918 [lua] client.lua:92: reportServiceInstance(): Instance report fails, connection refused, context: ngx.timer
I found this to be the code for the skywalking module, even though I did not configure the skywalking plugin
The function call stack is as follows:
skywalking.lua#init() --> client.lua#startBackendTimer() --> client.lua#reportServiceInstance()
It may be necessary to verify that the user has configured the skywalking plugin during the init phase.
Environment
- apisix version (cmd:
apisix version): lastest - OS: centos7
Minimal test code / Steps to reproduce the issue
just start apisix, then watch the error.log
What's the actual result? (including assertion message & call stack if applicable)
What's the expected result?
Do not export any logs from the skywalking module without the skywalking plugin enabled.
“just start apisix, then watch the error.log” ——Can you tell me how long need to wait? This is very helpful for design test cases.
Current solution:
You can copy the plugin you need from config-default.yaml to config.yaml without skywalking, like this:
plugins:
... # plugin you need
# without - skywalking
So the skywalking background timer will not be triggered anymore.
@membphis Maybe we can make skywalking disable by default so the background timer won't be a problem.
“just start apisix, then watch the error.log” ——Can you tell me how long need to wait? This is very helpful for design test cases.
3 seconds.
https://github.com/apache/skywalking-nginx-lua/blob/cda47ae0a507ab86a378a298325c3c94d9a773c2/lib/skywalking/client.lua#L28-L48
@membphis Maybe we can make skywalking disable by default so the background timer won't be a problem.
I also suffer from this problem in my dev environment, which may distrubs the result of unit test (no_error_log or the analogues ).
“just start apisix, then watch the error.log” ——Can you tell me how long need to wait? This is very helpful for design test cases.
3 seconds.
https://github.com/apache/skywalking-nginx-lua/blob/cda47ae0a507ab86a378a298325c3c94d9a773c2/lib/skywalking/client.lua#L28-L48
thanks
Maybe we can make skywalking disable by default so the background timer won't be a problem.
agree ^_^