-
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
suggestion: periodic lock time change to configurable (0.001 change to configurable) #32
Comments
We already do that:
If it is really 2 intervals, then did you experience a worker process failing, or an nginx reload? Can you reproduce the behaviour? |
I add some log info in healthcheck.lua for debugging.In the test,I create a checker with 20 seconds interval (NOTICE:the nginx and the upstream are on the same machine).I log the interval of calling of function get_periodic_lock(),which is marked as time_between.And then I found that sometimes the interval is less than 19.999 ( 20 - 0.001),so function get_periodic_lock() return false due to shm key exists.The log is in the last. To solve this problem in my case,I simplyly change 0.001 to 0.01 and it works for me .So,I suggested let 0.001 change to configurable .But I don't know what causes this problem,may be the timer start earlier?
edit: reformatted log |
the log you added there is only a single worker. Can you add the complete log? because it might be that another worker ran the missing healthchecks instead of this one. |
My nginx have two worker,but I only create checker in one worker,another worker no checker. |
how did you do that? can you show the code? |
I only add a flag in my lua code |
local ok, err = self.shm:add(key, true, interval - 0.001)
I use lua-resty-healthcheck to test, and found that sometimes there will only one checks between 2 interval(There is only one worker start health checker).This is because the checker process to fast ,the time of consuming is less than 0.001。So,I suggest that the shm key expire time can be controled。
The text was updated successfully, but these errors were encountered: