You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for providing such a great project. I encountered some problems while using it.
Test according to the test case, the following code:
location = /t {
content_by_lua_block {
local we = require "resty.worker.events"
assert(we.configure{ shm = "my_worker_events", interval = 0.1 })
local healthcheck = require("resty.healthcheck")
local checker = healthcheck.new({
name = "testing",
shm_name = "test_shm",
checks = {
active = {
http_path = "/status",
healthy = {
interval = 999, -- we don't want active checks
successes = 1,
},
unhealthy = {
interval = 999, -- we don't want active checks
tcp_failures = 1,
http_failures = 1,
}
},
passive = {
healthy = {
successes = 1,
},
unhealthy = {
tcp_failures = 1,
http_failures = 1,
}
}
}
})
ngx.sleep(0.1) -- wait for initial timers to run once
local ok, err = checker:add_target("127.0.0.1", 8088, nil, true)
ngx.say(checker:get_target_status("127.0.0.1", 8088)) -- true
checker:report_tcp_failure("127.0.0.1", 8088)
ngx.say(checker:get_target_status("127.0.0.1", 8088)) -- false
checker:report_success("127.0.0.1", 8088)
ngx.say(checker:get_target_status("127.0.0.1", 8088)) -- true
}
}
The result of execution is:
curl http://127.0.0.1:8085/t
false
false
true
Why can't I reproduce the same results as your test case?
In other words, after executing checker:add_target, the result of executing checker:get_target_status for the first time is false.
I can confirm that my corresponding interface exists: as follows
curl -I http://127.0.0.1:8088/status
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Mon, 04 Mar 2024 15:53:43 GMT
Content-Length: 15
Please tell me if there is anything wrong here;Thx
the openresty version of mine is 1.13.
The text was updated successfully, but these errors were encountered:
Furthermore, when I tested according to the Synopsis method, the corresponding IP and port could not be detected;
That is to say, I executed it exactly as in the Synopsis case.
When I killed the IP and port specified in checker:add_target, I did not see any messages in the log. (It is expected that the checker.events.unhealthy event will be hit)
Thank you for providing such a great project. I encountered some problems while using it.
Test according to the test case, the following code:
The result of execution is:
Why can't I reproduce the same results as your test case?
In other words, after executing checker:add_target, the result of executing checker:get_target_status for the first time is false.
I can confirm that my corresponding interface exists: as follows
Please tell me if there is anything wrong here;Thx
the openresty version of mine is 1.13.
The text was updated successfully, but these errors were encountered: