apisix icon indicating copy to clipboard operation
apisix copied to clipboard

bug: the latest version of the skywalking plugin always outputs error log

Open tzssangglass opened this issue 6 years ago • 7 comments

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.

tzssangglass avatar Nov 04 '20 07:11 tzssangglass

“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.

idbeta avatar Nov 04 '20 09:11 idbeta

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.

spacewander avatar Nov 04 '20 09:11 spacewander

@membphis Maybe we can make skywalking disable by default so the background timer won't be a problem.

spacewander avatar Nov 04 '20 09:11 spacewander

“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

tzssangglass avatar Nov 04 '20 09:11 tzssangglass

@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 ).

tokers avatar Nov 04 '20 09:11 tokers

“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

idbeta avatar Nov 04 '20 10:11 idbeta

Maybe we can make skywalking disable by default so the background timer won't be a problem.

agree ^_^

membphis avatar Nov 04 '20 13:11 membphis