We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,在client.lua中有这样一段代码 if 0 == ngx.worker.id() and heartbeat_timer == nil then local ok, err = new_timer(delay, check) end 我的理解 0 == ngx.worker.id() 是为了避免在多个worker进程下都执行该定时器,所以只绑定到workerid为0的worker进程下。 但是当我kong restart重启时,worker进程有4个,当前工作的worker id有可能是从0-3任何一个,如果恰巧不是0,就导致trimer不会被执行,造成链路不上报。 所以我把0 == ngx.worker.id()给去掉了,请问这样可行吗?会有什么问题? 谢谢。
if 0 == ngx.worker.id() and heartbeat_timer == nil then local ok, err = new_timer(delay, check) end
The text was updated successfully, but these errors were encountered:
可以在handler.lua sw_client:startBackendTimer(config) 前获取一下当前worker id并传递到client.lua中,作为指定执行上报的worker id,避免多个worker都执行上报任务。具体修改方式: handler.lua: config.worker_id = ngx.worker.id() sw_client:startBackendTimer(config) client.lua: local worker_id = config.worker_id if worker_id == ngx.worker.id() and heartbeat_timer == nil then
可以解决部署环境获取不到id为0的worker导致trace数据无法上报的问题
Sorry, something went wrong.
No branches or pull requests
你好,在client.lua中有这样一段代码
if 0 == ngx.worker.id() and heartbeat_timer == nil then local ok, err = new_timer(delay, check) end
我的理解 0 == ngx.worker.id() 是为了避免在多个worker进程下都执行该定时器,所以只绑定到workerid为0的worker进程下。
但是当我kong restart重启时,worker进程有4个,当前工作的worker id有可能是从0-3任何一个,如果恰巧不是0,就导致trimer不会被执行,造成链路不上报。
所以我把0 == ngx.worker.id()给去掉了,请问这样可行吗?会有什么问题?
谢谢。
The text was updated successfully, but these errors were encountered: