-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
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
Fix the issue: multi kong woker processes will premature trigger other woker processes's event callback #18
Conversation
…sses load targets, and trigger other workers's event callback, and result in the event_handler method error at line 925: the targets is nil when index it's ip field.
@hishamhm Hi, could you deal this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good — minor indentation fix to be made before merge
lib/resty/healthcheck.lua
Outdated
@@ -1295,6 +1289,12 @@ function _M.new(opts) | |||
if not ok then | |||
self:log(ERR, "Error loading initial target list: ", err) | |||
end | |||
|
|||
self.ev_callback = function(data, event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix the indentation on this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@wuguangkuo Thanks for the patch! does this change alone fix the Kong issue? |
Yes, the error log was not appeared after this modification. |
@wuguangkuo Merged, thank you! |
I will push a patch release shortly. |
Fix the issue: When restart kong process, the concurrent worker processes load targets, and premature trigger other workers's event callback, and result in the event_handler method error at line 925: the targets is nil when index it's ip field. The issue I commited at "Kong" project: Kong/kong#4453