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
Copy file name to clipboardExpand all lines: health_check.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Initializes the health check object, overiding default params with the given one
20
20
21
21
`syntax: health_check.report_failure(etcd_host)`
22
22
23
-
Reports a health failure which will count against the number of occurrences required to make a target "fail".
23
+
Reports a health failure which will count against the number of occurrences required to make a target "fail".
24
24
25
25
### get_target_status
26
26
@@ -35,6 +35,7 @@ Get the current status of the target.
35
35
| shm_name | string | required || the declarative `lua_shared_dict` is used to store the health status of endpoints. |
36
36
| fail_timeout | integer | optional | 10s | sets the time during which the specified number of unsuccessful attempts to communicate with the endpoint should happen to marker the endpoint unavailable, and also sets the period of time the endpoint will be marked unavailable. |
37
37
| max_fails | integer | optional | 1 | sets the number of failed attempts that must occur during the `fail_timeout` period for the endpoint to be marked unavailable. |
38
+
| retry | bool | optional | false | automatically retry another endpoint when operations failed. |
38
39
39
40
lua example:
40
41
@@ -43,16 +44,17 @@ local health_check, err = require("resty.etcd.health_check").init({
43
44
shm_name="healthcheck_shm",
44
45
fail_timeout=10,
45
46
max_fails=1,
47
+
retry=false,
46
48
})
47
49
```
48
50
49
-
In a `fail_timeout`, if there are `max_fails` consecutive failures, the endpoint is marked as unhealthy, the unhealthy endpoint will not be choosed to connect for a `fail_timeout` time in the future.
51
+
In a `fail_timeout`, if there are `max_fails` consecutive failures, the endpoint is marked as unhealthy, the unhealthy endpoint will not be choosed to connect for a `fail_timeout` time in the future.
50
52
51
53
Health check mechanism would switch endpoint only when the previously choosed endpoint is marked as unhealthy.
52
54
53
55
The failure counter and health status of each etcd endpoint are shared across workers and by different etcd clients.
54
56
55
-
Also note that the `fail_timeout`and `max_fails` of the health check cannot be changed once it has been created.
57
+
Also note that the `fail_timeout`, `max_fails`and `retry` of the health check cannot be changed once it has been created.
0 commit comments